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.
This commit is contained in:
Georg Baum 2014-03-06 22:00:12 +01:00
parent 474e42923b
commit ba8c5bb511

View File

@ -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'))