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.
This commit is contained in:
Georg Baum 2014-03-06 21:42:51 +01:00
parent b57eb39731
commit 474e42923b

View File

@ -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 != '':