]> git.lyx.org Git - lyx.git/blobdiff - po/lyx_pot.py
Update the button text of InsetInclude insets
[lyx.git] / po / lyx_pot.py
index 235f304fc8b2a34b907e33660b8d9725d2635acb..25cb1fd649ba84461aac679cb6a249092954305c 100755 (executable)
@@ -336,6 +336,8 @@ def layouts_l10n(input_files, output, base, layouttranslations):
             keys.append(key)
         keys.sort()
 
+        ContextRe = re.compile(r'(.*)(\[\[.*\]\])')
+
         print >> out, '''# This file has been automatically generated by po/lyx_pot.py.
 # PLEASE MODIFY ONLY THE LAGUAGES HAVING NO .po FILE! If you want to regenerate
 # this file from the translations, run `make ../lib/layouttranslations' in po.
@@ -372,8 +374,13 @@ def layouts_l10n(input_files, output, base, layouttranslations):
                 # also print untranslated entries to help translators
                 elif not lang in oldlanguages:
                     key = key.replace('\\', '\\\\').replace('"', '\\"')
+                    res = ContextRe.search(key)
+                    if res != None:
+                        val = res.group(1)
+                    else:
+                        val = key
                     print >> out, '\t"%s" "%s"' % \
-                             (key.encode('utf-8'), key.encode('utf-8'))
+                             (key.encode('utf-8'), val.encode('utf-8'))
             print >> out, 'End'
 
     out.close()