diff --git a/anki/lang.py b/anki/lang.py index 4e286043f..dd34c6ef6 100644 --- a/anki/lang.py +++ b/anki/lang.py @@ -2,7 +2,7 @@ # Copyright: Damien Elmes # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -import os, sys +import os, sys, re import gettext import threading @@ -93,5 +93,9 @@ def getLang(): else: return currentLang +def noHint(str): + "Remove translation hint from end of string." + return re.sub("(^.*?)( ?\(.+?\))?$", "\\1", str) + if not currentTranslation: setLang("en_US", local=False)