From 7a0f18d2c714c548eeeb6809dd1035c71b0985d8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 28 May 2012 17:17:57 +0900 Subject: [PATCH] translation hint stripping --- anki/lang.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)