зеркало из https://github.com/mozilla/bedrock.git
Fix bug 982755: Fix POT file conversion when string ends with quote.
This commit is contained in:
Родитель
06c0b1f0e9
Коммит
95a490bc2a
|
@ -29,7 +29,9 @@ def parse_po(path):
|
|||
|
||||
with codecs.open(path, 'r', 'utf-8') as lines:
|
||||
def parse_string(s):
|
||||
return s.strip('"').replace('\\"', '"')
|
||||
# remove first and last characters which are "
|
||||
s = s.strip()[1:-1]
|
||||
return s.replace('\\"', '"')
|
||||
|
||||
def extract_content(s):
|
||||
# strip the first word and quotes
|
||||
|
|
|
@ -24,3 +24,11 @@ msgstr ""
|
|||
#: templates/firefox/fx.html:112
|
||||
msgid "Find out if your device is supported »"
|
||||
msgstr ""
|
||||
|
||||
#. For bug 982755
|
||||
#: bedrock/firefox/templates/firefox/os/notes-1.3.html:164
|
||||
msgid ""
|
||||
"The WebIccManager API, which allows support for multiple sim cards, has had "
|
||||
"updates: iccChangeEvent has been added using using event generator <a href=\""
|
||||
"%(url1)s\">bug 814637</a>"
|
||||
msgstr ""
|
||||
|
|
|
@ -78,6 +78,12 @@ class TestPOFiles(TestCase):
|
|||
u'templates/some_lang_files.html': self.good_messages,
|
||||
u'templates/firefox/fx.html': [[None, u'Find out if your device '
|
||||
u'is supported »']],
|
||||
u'bedrock/firefox/templates/firefox/os/notes-1.3.html': [[
|
||||
u'For bug 982755',
|
||||
u'The WebIccManager API, which allows support for multiple sim cards, '
|
||||
u'has had updates: iccChangeEvent has been added using using event '
|
||||
u'generator <a href="%(url1)s">bug 814637</a>'
|
||||
]],
|
||||
}
|
||||
self.assertDictEqual(msgs, expected)
|
||||
|
||||
|
@ -90,7 +96,7 @@ class TestPOFiles(TestCase):
|
|||
langfiles_mock.return_value = ['some_lang_files',
|
||||
'firefox/fx']
|
||||
pot_to_langfiles()
|
||||
append_mock.assert_called_once_with(ANY, self.good_messages)
|
||||
append_mock.assert_called_with(ANY, self.good_messages)
|
||||
|
||||
@patch('os.path.exists', TRUE_MOCK)
|
||||
@patch('lib.l10n_utils.gettext.codecs')
|
||||
|
|
Загрузка…
Ссылка в новой задаче