mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Remove unneeded layout translations as hinted on the users list.
The standard babel names are used instead of these translations. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38296 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d41dfec5be
commit
910a517f69
File diff suppressed because it is too large
Load Diff
@ -96,7 +96,9 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
CounterFormat = re.compile(r'\s*PrettyFormat\s+"?(.*)"?')
|
||||
CiteFormat = re.compile(r'\s*CiteFormat')
|
||||
KeyVal = re.compile(r'^\s*_\w+\s+(.*)$')
|
||||
Float = re.compile(r'\s*Float')
|
||||
Float = re.compile(r'\s*Float\s*$')
|
||||
UsesFloatPkg = re.compile(r'\s*UsesFloatPkg\s+(.*)')
|
||||
IsPredefined = re.compile(r'\s*IsPredefined\s+(.*)')
|
||||
End = re.compile(r'\s*End')
|
||||
Comment = re.compile(r'\s*#')
|
||||
Translation = re.compile(r'\s*Translation\s+(.*)\s*$')
|
||||
@ -160,6 +162,10 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
readingI18nPreamble = False
|
||||
readingFloat = False
|
||||
readingCiteFormats = False
|
||||
isPredefined = False
|
||||
usesFloatPkg = True
|
||||
listname = ''
|
||||
floatname = ''
|
||||
descStartLine = -1
|
||||
descLines = []
|
||||
lineno = 0
|
||||
@ -222,7 +228,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
if layouttranslations:
|
||||
# gui name must only be added for floats
|
||||
if readingFloat:
|
||||
keyset.add(string)
|
||||
floatname = string
|
||||
else:
|
||||
writeString(out, src, base, lineno, string)
|
||||
continue
|
||||
@ -236,7 +242,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
if res != None:
|
||||
string = res.group(1)
|
||||
if layouttranslations:
|
||||
keyset.add(string.strip('"'))
|
||||
listname = string.strip('"')
|
||||
else:
|
||||
writeString(out, src, base, lineno, string)
|
||||
continue
|
||||
@ -268,13 +274,44 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
||||
if res != None:
|
||||
readingFloat = True
|
||||
continue
|
||||
res = IsPredefined.search(line)
|
||||
if res != None:
|
||||
string = res.group(1).lower()
|
||||
if string == 'true':
|
||||
isPredefined = True
|
||||
else:
|
||||
isPredefined = False
|
||||
continue
|
||||
res = UsesFloatPkg.search(line)
|
||||
if res != None:
|
||||
string = res.group(1).lower()
|
||||
if string == 'true':
|
||||
usesFloatPkg = True
|
||||
else:
|
||||
usesFloatPkg = False
|
||||
continue
|
||||
res = CiteFormat.search(line)
|
||||
if res != None:
|
||||
readingCiteFormats = True
|
||||
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
|
||||
# tufte-book.layout) and Planotable, Plate (both from aguplus.inc).
|
||||
if layouttranslations and readingFloat and usesFloatPkg and not isPredefined:
|
||||
if floatname != '':
|
||||
keyset.add(floatname)
|
||||
if listname != '':
|
||||
keyset.add(listname)
|
||||
isPredefined = False
|
||||
usesFloatPkg = True
|
||||
listname = ''
|
||||
floatname = ''
|
||||
readingCiteFormats = False
|
||||
readingFloat = False
|
||||
continue
|
||||
if readingCiteFormats:
|
||||
res = KeyVal.search(line)
|
||||
if res != None:
|
||||
|
Loading…
Reference in New Issue
Block a user