# match LabelString, EndLabelString, LabelStringAppendix and maybe others but no comments
LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*\S)\s*$', re.IGNORECASE)
MenuString = re.compile(r'^[^#]*MenuString\S*\s+(.*\S)\s*$', re.IGNORECASE)
# match LabelString, EndLabelString, LabelStringAppendix and maybe others but no comments
LabelString = re.compile(r'^[^#]*LabelString\S*\s+(.*\S)\s*$', re.IGNORECASE)
MenuString = re.compile(r'^[^#]*MenuString\S*\s+(.*\S)\s*$', re.IGNORECASE)
GuiName = re.compile(r'^\s*GuiName\s+(.*\S)\s*$', re.IGNORECASE)
ListName = re.compile(r'^\s*ListName\s+(.*\S)\s*$', re.IGNORECASE)
CategoryName = re.compile(r'^\s*Category\s+(.*\S)\s*$', re.IGNORECASE)
NameRE = re.compile(r'^\s*#\s*\\DeclareLyXModule.*{(.*)}$', re.IGNORECASE)
InsetLayout = re.compile(r'^InsetLayout\s+\"?(.*)\"?\s*$', re.IGNORECASE)
FlexCheck = re.compile(r'^Flex:(.*)', re.IGNORECASE)
GuiName = re.compile(r'^\s*GuiName\s+(.*\S)\s*$', re.IGNORECASE)
ListName = re.compile(r'^\s*ListName\s+(.*\S)\s*$', re.IGNORECASE)
CategoryName = re.compile(r'^\s*Category\s+(.*\S)\s*$', re.IGNORECASE)
NameRE = re.compile(r'^\s*#\s*\\DeclareLyXModule.*{(.*)}$', re.IGNORECASE)
InsetLayout = re.compile(r'^InsetLayout\s+\"?(.*)\"?\s*$', re.IGNORECASE)
FlexCheck = re.compile(r'^Flex:(.*)', re.IGNORECASE)
DescBegin = re.compile(r'^\s*#DescriptionBegin\s*$', re.IGNORECASE)
DescEnd = re.compile(r'^\s*#\s*DescriptionEnd\s*$', re.IGNORECASE)
Category = re.compile(r'^\s*#\s*Category:\s+(.*\S)\s*$', re.IGNORECASE)
DescBegin = re.compile(r'^\s*#DescriptionBegin\s*$', re.IGNORECASE)
DescEnd = re.compile(r'^\s*#\s*DescriptionEnd\s*$', re.IGNORECASE)
Category = re.compile(r'^\s*#\s*Category:\s+(.*\S)\s*$', re.IGNORECASE)
#if not layouttranslations:
# writeString(out, src, base, lineno, string)
m = FlexCheck.search(string)
#if not layouttranslations:
# writeString(out, src, base, lineno, string)
m = FlexCheck.search(string)
+ if m:
+ if not layouttranslations:
+ writeString(out, src, base, lineno, m.group(1))
+ m = CaptionCheck.search(string)
if m:
if not layouttranslations:
writeString(out, src, base, lineno, m.group(1))
if m:
if not layouttranslations:
writeString(out, src, base, lineno, m.group(1))
- # 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
key = key.replace('\\', '\\\\').replace('"', '\\"')
print >> out, '\t"%s" "%s"' % \
(key.encode('utf-8'), val.encode('utf-8'))
key = key.replace('\\', '\\\\').replace('"', '\\"')
print >> out, '\t"%s" "%s"' % \
(key.encode('utf-8'), val.encode('utf-8'))
Template = re.compile(r'^Template\s+(.*)', re.IGNORECASE)
GuiName = re.compile(r'\s*GuiName\s+(.*)', re.IGNORECASE)
HelpTextStart = re.compile(r'\s*HelpText\s', re.IGNORECASE)
Template = re.compile(r'^Template\s+(.*)', re.IGNORECASE)
GuiName = re.compile(r'\s*GuiName\s+(.*)', re.IGNORECASE)
HelpTextStart = re.compile(r'\s*HelpText\s', re.IGNORECASE)
output = open(output, 'w')
# assuming only one encodings file
# Encoding utf8 utf8 "Unicode (utf8)" UTF-8 variable inputenc
output = open(output, 'w')
# assuming only one encodings file
# Encoding utf8 utf8 "Unicode (utf8)" UTF-8 variable inputenc
input = open(input_files[0])
for lineno, line in enumerate(input.readlines()):
if not line.startswith('Encoding'):
input = open(input_files[0])
for lineno, line in enumerate(input.readlines()):
if not line.startswith('Encoding'):