]> git.lyx.org Git - features.git/commitdiff
Fix logic error in layout translation extraction
authorGeorg Baum <baum@lyx.org>
Thu, 6 Mar 2014 20:42:51 +0000 (21:42 +0100)
committerGeorg Baum <baum@lyx.org>
Thu, 6 Mar 2014 20:42:51 +0000 (21:42 +0100)
lyx_pot.py treats the combination IsPredefined == true and UsesFloatPkg == true
incorrectly: In this case it does not extract the float name, although it needs
to be extracted. This was no problem for LyX 2.0.0, because no layout contained
this combination fo flags. However, the current version of achemso.layout uses
it for several styles, e.g. "List of Schemes".
You only see the bug if you remove lib/layouttranslations before updating it,
otherwise it would be covered by the old translations which are kept. The fix
make use of the fact that IsPredefined == false and UsesFloatPkg == false is
not supported by LyX to simplify the logic.

po/lyx_pot.py

index 7d9a3fc164de325778fd1018a34f8e32cc36c976..769fe21c2e4155c2b83e8afe16ad73685d5fe27b 100755 (executable)
@@ -334,11 +334,14 @@ def layouts_l10n(input_files, output, base, layouttranslations):
                 continue
             res = End.search(line)
             if res != None:
-                # If a float is predefined by the package and it does not need
-                # the float package then it uses the standard babel translations.
-                # This is even true for MarginFigure, MarginTable (both from
+                # We have four combinations of the flags usesFloatPkg and isPredefined:
+                #     usesFloatPkg and     isPredefined: might use standard babel translations
+                #     usesFloatPkg and not isPredefined: does not use standard babel translations
+                # not usesFloatPkg and     isPredefined: uses standard babel translations
+                # not usesFloatPkg and not isPredefined: not supported by LyX
+                # The third combination is even true for MarginFigure, MarginTable (both from
                 # tufte-book.layout) and Planotable, Plate (both from aguplus.inc).
-                if layouttranslations and readingFloat and usesFloatPkg and not isPredefined:
+                if layouttranslations and readingFloat and usesFloatPkg:
                     if floatname != '':
                         keyset.add(floatname)
                     if listname != '':