output = open(output, 'w')
Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"')
Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"')
output = open(output, 'w')
Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"')
Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"')
Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"')
Item = re.compile(r'[^#]*Item\s+"([^"]*)"')
TableInsert = re.compile(r'[^#]*TableInsert\s+"([^"]*)"')
Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"')
Item = re.compile(r'[^#]*Item\s+"([^"]*)"')
TableInsert = re.compile(r'[^#]*TableInsert\s+"([^"]*)"')
string = string.replace('_', ' ')
elif Popupmenu.match(line):
(string,) = Popupmenu.match(line).groups()
string = string.replace('_', ' ')
elif Popupmenu.match(line):
(string,) = Popupmenu.match(line).groups()
elif Toolbar.match(line):
(string,) = Toolbar.match(line).groups()
elif Item.match(line):
elif Toolbar.match(line):
(string,) = Toolbar.match(line).groups()
elif Item.match(line):
InsetLayout = re.compile(r'^InsetLayout\s+(.*)')
DescBegin = re.compile(r'#+\s*DescriptionBegin\s*$')
DescEnd = re.compile(r'#+\s*DescriptionEnd\s*$')
InsetLayout = re.compile(r'^InsetLayout\s+(.*)')
DescBegin = re.compile(r'#+\s*DescriptionBegin\s*$')
DescEnd = re.compile(r'#+\s*DescriptionEnd\s*$')
- I18nPreamble = re.compile(r'\s*I18nPreamble\s*$')
- EndI18nPreamble = re.compile(r'\s*EndI18nPreamble\s*$')
+ Category = re.compile(r'#Category: (.*)$')
+ I18nPreamble = re.compile(r'\s*(Lang)|(Babel)Preamble\s*$')
+ EndI18nPreamble = re.compile(r'\s*End(Lang)|(Babel)Preamble\s*$')
string = string.replace('_', ' ')
writeString(out, src, base, lineno, string)
continue
string = string.replace('_', ' ')
writeString(out, src, base, lineno, string)
continue
string = string.replace('&', '&').replace('<', '<').replace('>', '>')
string = string.replace('\\', '\\\\').replace('"', r'\"')
print >> output, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % \
string = string.replace('&', '&').replace('<', '<').replace('>', '>')
string = string.replace('\\', '\\\\').replace('"', r'\"')
print >> output, '#: %s:%d\nmsgid "%s"\nmsgstr ""\n' % \
- (relativePath(src, base), lineno+1, string)
+ (relativePath(src, base), lineno+1, string)
--base:
path to the top source directory. default to '.'
--output:
output pot file, default to './lyx.pot'
--base:
path to the top source directory. default to '.'
--output:
output pot file, default to './lyx.pot'
- optlist, args = getopt.getopt(sys.argv[1:], 'ht:o:b:',
- ['help', 'type=', 'output=', 'base='])
+ optlist, args = getopt.getopt(sys.argv[1:], 'ht:o:b:s:',
+ ['help', 'type=', 'output=', 'base=', 'src_file='])
for (opt, value) in optlist:
if opt in ['-h', '--help']:
print Usage
for (opt, value) in optlist:
if opt in ['-h', '--help']:
print Usage
if input_type not in ['ui', 'layouts', 'modules', 'qt4', 'languages', 'encodings', 'external', 'formats'] or output is None:
print 'Wrong input type or output filename.'
sys.exit(1)
if input_type not in ['ui', 'layouts', 'modules', 'qt4', 'languages', 'encodings', 'external', 'formats'] or output is None:
print 'Wrong input type or output filename.'
sys.exit(1)