From ba8c5bb5112cdeaea507a46cb144c17c12cd5caf Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 6 Mar 2014 22:00:12 +0100 Subject: [PATCH] Remove context also for translated strings This is consistent with the treatment in LyX itself (cleanTranslation() is also called on the translated strings), and some translators leave the context in the translated msgstr (e.g. [[List of Listings]]), although that is not recommended. Without this, lib/layouttranslations would contain wrong translations. --- po/lyx_pot.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/po/lyx_pot.py b/po/lyx_pot.py index 769fe21c2e..b6f97dc2cc 100755 --- a/po/lyx_pot.py +++ b/po/lyx_pot.py @@ -404,6 +404,9 @@ def layouts_l10n(input_files, output, base, layouttranslations): for key in keys: if key in trans.keys(): val = trans[key].replace('\\', '\\\\').replace('"', '\\"') + res = ContextRe.search(val) + if res != None: + val = res.group(1) key = key.replace('\\', '\\\\').replace('"', '\\"') print >> out, '\t"%s" "%s"' % \ (key.encode('utf-8'), val.encode('utf-8')) -- 2.39.5