commit 474e42923be1505a7a1a4ec40048e3a39a498345
Author: Georg Baum <[email protected]>
Date:   Thu Mar 6 21:42:51 2014 +0100

    Fix logic error in layout translation extraction
    
    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.

diff --git a/po/lyx_pot.py b/po/lyx_pot.py
index 7d9a3fc..769fe21 100755
--- a/po/lyx_pot.py
+++ b/po/lyx_pot.py
@@ -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 != '':

Reply via email to