X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=po%2Flyx_pot.py;h=4e15b1f13971cdd6ac1034225d1443463d65ab43;hb=58a8884b0643ff8dcf35697e09e49894a804171b;hp=0fc3acaa08c09e0c0ff7a33a429dc6af187a837b;hpb=322808281ff449c542295c8e07d5b6c4c950b571;p=features.git
diff --git a/po/lyx_pot.py b/po/lyx_pot.py
index 0fc3acaa08..4e15b1f139 100755
--- a/po/lyx_pot.py
+++ b/po/lyx_pot.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
# -*- coding: utf-8 -*-
# file lyx_pot.py
@@ -18,7 +18,7 @@
#
from __future__ import print_function
-import sys, os, re, getopt
+import glob, sys, os, re, getopt
import io
def relativePath(path, base):
@@ -47,6 +47,7 @@ def ui_l10n(input_files, output, base):
output = io.open(output, 'w', encoding='utf_8', newline='\n')
Submenu = re.compile(r'^[^#]*Submenu\s+"([^"]*)"', re.IGNORECASE)
Popupmenu = re.compile(r'^[^#]*PopupMenu\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
+ Dynamicmenu = re.compile(r'^[^#]*DynamicMenu\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
IconPalette = re.compile(r'^[^#]*IconPalette\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
Toolbar = re.compile(r'^[^#]*Toolbar\s+"[^"]+"\s+"([^"]*)"', re.IGNORECASE)
Item = re.compile(r'[^#]*Item\s+"([^"]*)"', re.IGNORECASE)
@@ -59,6 +60,8 @@ def ui_l10n(input_files, output, base):
string = string.replace('_', ' ')
elif Popupmenu.match(line):
(string,) = Popupmenu.match(line).groups()
+ elif Dynamicmenu.match(line):
+ (string,) = Dynamicmenu.match(line).groups()
elif IconPalette.match(line):
(string,) = IconPalette.match(line).groups()
elif Toolbar.match(line):
@@ -85,7 +88,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
# 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)
- OutlinerName = re.compile(r'^[^#]*OutlinerName\s+(\S+|\"[^\"]*\")\s+(\S+|\"[^\"]*\")\s*$', re.IGNORECASE)
+ OutlinerName = re.compile(r'^[^#]*OutlinerName\s+(\S+|\"[^\"]*\")\s+\"([^\"]*)\"', re.IGNORECASE)
Tooltip = re.compile(r'^\s*Tooltip\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)
@@ -95,7 +98,7 @@ def layouts_l10n(input_files, output, base, layouttranslations):
InsetLayout = re.compile(r'^InsetLayout\s+\"?(.*)\"?\s*$', re.IGNORECASE)
FlexCheck = re.compile(r'^Flex:(.*)', re.IGNORECASE)
CaptionCheck = re.compile(r'^Caption:(.*)', re.IGNORECASE)
- DescBegin = re.compile(r'^\s*#DescriptionBegin\s*$', re.IGNORECASE)
+ DescBegin = re.compile(r'^\s*#\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)
I18nPreamble = re.compile(r'^\s*((Lang)|(Babel))Preamble\s*$', re.IGNORECASE)
@@ -442,8 +445,8 @@ def layouts_l10n(input_files, output, base, layouttranslations):
out.close()
-def qt4_l10n(input_files, output, base):
- '''Generate pot file from src/frontends/qt4/ui/*.ui'''
+def qt_l10n(input_files, output, base):
+ '''Generate pot file from src/frontends/qt/ui/*.ui'''
output = io.open(output, 'w', encoding='utf_8', newline='\n')
pat = re.compile(r'\s*(.*)')
prop = re.compile(r'\s*