mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
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:
parent
474e42923b
commit
ba8c5bb511
@ -404,6 +404,9 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
for key in keys:
|
for key in keys:
|
||||||
if key in trans.keys():
|
if key in trans.keys():
|
||||||
val = trans[key].replace('\\', '\\\\').replace('"', '\\"')
|
val = trans[key].replace('\\', '\\\\').replace('"', '\\"')
|
||||||
|
res = ContextRe.search(val)
|
||||||
|
if res != None:
|
||||||
|
val = res.group(1)
|
||||||
key = key.replace('\\', '\\\\').replace('"', '\\"')
|
key = key.replace('\\', '\\\\').replace('"', '\\"')
|
||||||
print >> out, '\t"%s" "%s"' % \
|
print >> out, '\t"%s" "%s"' % \
|
||||||
(key.encode('utf-8'), val.encode('utf-8'))
|
(key.encode('utf-8'), val.encode('utf-8'))
|
||||||
|
Loading…
Reference in New Issue
Block a user