mirror of https://gitlab.com/openlp/openlp.git
Merge get-strings: Improve regex to extract translation strings.
https://code.launchpad.net/~mgorven/openlp/get-strings/+merge/15120 bzr-revno: 674
This commit is contained in:
commit
b401179613
|
@ -42,7 +42,7 @@ ts_message = u""" <message>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
"""
|
"""
|
||||||
find_trUtf8 = re.compile(r"trUtf8\(u'([\.:;\\&\w]+)'\)", re.UNICODE)
|
find_trUtf8 = re.compile(r"trUtf8\(u?(['\"])([^\1]+)\1\)", re.UNICODE)
|
||||||
strings = {}
|
strings = {}
|
||||||
|
|
||||||
def parse_file(filename):
|
def parse_file(filename):
|
||||||
|
@ -56,9 +56,9 @@ def parse_file(filename):
|
||||||
class_name = line[6:line.find(u'(')]
|
class_name = line[6:line.find(u'(')]
|
||||||
continue
|
continue
|
||||||
for match in find_trUtf8.finditer(line):
|
for match in find_trUtf8.finditer(line):
|
||||||
key = u'%s-%s' % (class_name, match.group(1))
|
key = u'%s-%s' % (class_name, match.group(2))
|
||||||
if not key in strings:
|
if not key in strings:
|
||||||
strings[key] = [class_name, filename, line_number, match.group(1)]
|
strings[key] = [class_name, filename, line_number, match.group(2)]
|
||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
def write_file(filename):
|
def write_file(filename):
|
||||||
|
|
|
@ -193,7 +193,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
|
||||||
|
|
||||||
def onImageToolButtonClicked(self):
|
def onImageToolButtonClicked(self):
|
||||||
filename = QtGui.QFileDialog.getOpenFileName(
|
filename = QtGui.QFileDialog.getOpenFileName(
|
||||||
self, self.trUtf8('Open file'))
|
self, self.trUtf8(u'Open file'))
|
||||||
if filename:
|
if filename:
|
||||||
self.ImageLineEdit.setText(filename)
|
self.ImageLineEdit.setText(filename)
|
||||||
self.theme.background_filename = filename
|
self.theme.background_filename = filename
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
1.9.0-673
|
1.9.0-674
|
||||||
|
|
Loading…
Reference in New Issue