mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-19 22:40:26 +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+"?(.*)"?')
|
CounterFormat = re.compile(r'\s*PrettyFormat\s+"?(.*)"?')
|
||||||
CiteFormat = re.compile(r'\s*CiteFormat')
|
CiteFormat = re.compile(r'\s*CiteFormat')
|
||||||
KeyVal = re.compile(r'^\s*_\w+\s+(.*)$')
|
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')
|
End = re.compile(r'\s*End')
|
||||||
Comment = re.compile(r'\s*#')
|
Comment = re.compile(r'\s*#')
|
||||||
Translation = re.compile(r'\s*Translation\s+(.*)\s*$')
|
Translation = re.compile(r'\s*Translation\s+(.*)\s*$')
|
||||||
@ -160,6 +162,10 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
readingI18nPreamble = False
|
readingI18nPreamble = False
|
||||||
readingFloat = False
|
readingFloat = False
|
||||||
readingCiteFormats = False
|
readingCiteFormats = False
|
||||||
|
isPredefined = False
|
||||||
|
usesFloatPkg = True
|
||||||
|
listname = ''
|
||||||
|
floatname = ''
|
||||||
descStartLine = -1
|
descStartLine = -1
|
||||||
descLines = []
|
descLines = []
|
||||||
lineno = 0
|
lineno = 0
|
||||||
@ -222,7 +228,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
if layouttranslations:
|
if layouttranslations:
|
||||||
# gui name must only be added for floats
|
# gui name must only be added for floats
|
||||||
if readingFloat:
|
if readingFloat:
|
||||||
keyset.add(string)
|
floatname = string
|
||||||
else:
|
else:
|
||||||
writeString(out, src, base, lineno, string)
|
writeString(out, src, base, lineno, string)
|
||||||
continue
|
continue
|
||||||
@ -236,7 +242,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
if res != None:
|
if res != None:
|
||||||
string = res.group(1)
|
string = res.group(1)
|
||||||
if layouttranslations:
|
if layouttranslations:
|
||||||
keyset.add(string.strip('"'))
|
listname = string.strip('"')
|
||||||
else:
|
else:
|
||||||
writeString(out, src, base, lineno, string)
|
writeString(out, src, base, lineno, string)
|
||||||
continue
|
continue
|
||||||
@ -268,13 +274,44 @@ def layouts_l10n(input_files, output, base, layouttranslations):
|
|||||||
if res != None:
|
if res != None:
|
||||||
readingFloat = True
|
readingFloat = True
|
||||||
continue
|
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)
|
res = CiteFormat.search(line)
|
||||||
if res != None:
|
if res != None:
|
||||||
readingCiteFormats = True
|
readingCiteFormats = True
|
||||||
|
continue
|
||||||
res = End.search(line)
|
res = End.search(line)
|
||||||
if res != None:
|
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
|
readingCiteFormats = False
|
||||||
readingFloat = False
|
readingFloat = False
|
||||||
|
continue
|
||||||
if readingCiteFormats:
|
if readingCiteFormats:
|
||||||
res = KeyVal.search(line)
|
res = KeyVal.search(line)
|
||||||
if res != None:
|
if res != None:
|
||||||
|
Loading…
Reference in New Issue
Block a user