mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
translation hint stripping
This commit is contained in:
parent
ee691cc608
commit
7a0f18d2c7
1 changed files with 5 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
# Copyright: Damien Elmes <anki@ichi2.net>
|
# Copyright: Damien Elmes <anki@ichi2.net>
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import os, sys
|
import os, sys, re
|
||||||
import gettext
|
import gettext
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
|
@ -93,5 +93,9 @@ def getLang():
|
||||||
else:
|
else:
|
||||||
return currentLang
|
return currentLang
|
||||||
|
|
||||||
|
def noHint(str):
|
||||||
|
"Remove translation hint from end of string."
|
||||||
|
return re.sub("(^.*?)( ?\(.+?\))?$", "\\1", str)
|
||||||
|
|
||||||
if not currentTranslation:
|
if not currentTranslation:
|
||||||
setLang("en_US", local=False)
|
setLang("en_US", local=False)
|
||||||
|
|
Loading…
Reference in a new issue