]> git.lyx.org Git - lyx.git/blobdiff - po/lyx_pot.py
Reorder and clean up the beamer layout
[lyx.git] / po / lyx_pot.py
index f247279b446a5b47ee82f6cfd09b0c1516f6a3de..ce7b68a35812f72214c3f501a5c2ff7c2d7bd4af 100755 (executable)
@@ -35,6 +35,7 @@ def ui_l10n(input_files, output, base):
     '''Generate pot file from lib/ui/*'''
     output = open(output, 'w')
     Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"')
+    Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"')
     Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"')
     Item = re.compile(r'[^#]*Item\s+"([^"]*)"')
     for src in input_files:
@@ -43,13 +44,15 @@ def ui_l10n(input_files, output, base):
             if Submenu.match(line):
                 (string,) = Submenu.match(line).groups()
                 string = string.replace('_', ' ')
+            elif Popupmenu.match(line):
+                (string,) = Popupmenu.match(line).groups()
             elif Toolbar.match(line):
                 (string,) = Toolbar.match(line).groups()
             elif Item.match(line):
                 (string,) = Item.match(line).groups()
             else:
                 continue
-            string = string.replace('\\', '\\\\').replace('"', '')
+            string = string.replace('"', '')
             if string != "":
                 print >> output, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % \
                     (relativePath(src, base), lineno+1, string)
@@ -121,7 +124,7 @@ def languages_l10n(input_files, output, base):
     for lineno, line in enumerate(input.readlines()):
         if line[0] == '#':
             continue
-        items = line.split('"')
+        items = line.split()
         # empty lines?
         if len(items) < 3:
             continue
@@ -132,7 +135,7 @@ def languages_l10n(input_files, output, base):
         #   msgid "Afrikaans"
         #   msgstr ""
         # I do not care extra "s like "af_ZA"
-        print >> output, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % (relativePath(input_files[0], base), lineno+1, items[1])
+        print >> output, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % (relativePath(input_files[0], base), lineno+1, items[2].strip('"'))
     input.close()
     output.close()