po/lyx_pot.py: handles PopupMenu in lib/ui/* ("Math Spacing" etc are translated now)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17912 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2007-04-22 21:27:28 +00:00
parent 1d992d1661
commit ee9782c624

View File

@ -35,6 +35,7 @@ def ui_l10n(input_files, output, base):
'''Generate pot file from lib/ui/*''' '''Generate pot file from lib/ui/*'''
output = open(output, 'w') output = open(output, 'w')
Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"') Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"')
Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"')
Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"') Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"')
Item = re.compile(r'[^#]*Item\s+"([^"]*)"') Item = re.compile(r'[^#]*Item\s+"([^"]*)"')
for src in input_files: for src in input_files:
@ -43,6 +44,8 @@ def ui_l10n(input_files, output, base):
if Submenu.match(line): if Submenu.match(line):
(string,) = Submenu.match(line).groups() (string,) = Submenu.match(line).groups()
string = string.replace('_', ' ') string = string.replace('_', ' ')
elif Popupmenu.match(line):
(string,) = Popupmenu.match(line).groups()
elif Toolbar.match(line): elif Toolbar.match(line):
(string,) = Toolbar.match(line).groups() (string,) = Toolbar.match(line).groups()
elif Item.match(line): elif Item.match(line):