]> git.lyx.org Git - lyx.git/blobdiff - po/lyx_pot.py
Fix bug 2474; partial fix for 1777. Added last_reference_ member to QRef class and...
[lyx.git] / po / lyx_pot.py
index 2dd883aec5fd0fc5e45fd8df6b26ee59c9cae824..23094aed7da4515159c2e9b7e93d24448c1edede 100755 (executable)
@@ -25,13 +25,17 @@ def relativePath(path, base):
     path2 = os.path.normpath(os.path.realpath(base)).split(os.sep)
     if path1[:len(path2)] != path2:
         print "Path %s is not under top source directory" % path
-    return os.path.join(*path1[len(path2):])
+    path3 = os.path.join(*path1[len(path2):]);
+    # replace all \ by / such that we get the same comments on Windows and *nix
+    path3 = path3.replace('\\', '/')
+    return path3
 
 
 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:
@@ -40,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)