Closed gnerred closed 7 years ago
Looks like the same as #2725 but in the l10nv1tov2.py , but there is already a .encode("utf-8")
that should handle the problem... I'll take a look.
Ok, that creates the problem, that doesn't handle it... We should convert this string as unicode.
To test, you can open the file in <your_project>.build/venv/lib/python2.7/site-packages/c2cgeoportal/scripts/c2cgeoportal/scripts/l10nv1tov2.py
And a u
just before the 3 double-quotes at the line destionation.write(("""
(line ~93 (and not 82))
So to get this:
with open(options.po_v2, "w+") as destionation:
destionation.write("""msgid ""
msgstr ""
"Last-Translator: Imported from {0!s}\\n"
"Language: {1!s}\\n"
"MIME-Version: 1.0\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\\n"
""".format(options.json_v1, options.lang))
for key, value in source.items():
if isinstance(value, basestring):
destionation.write((u"""
msgid "{0!s}"
msgstr "{1!s}"
""".format(key, value.replace('"', '\\"'))).encode("utf-8"),
Then do (only) a graceful an launch the script again.
Please, save your files before testing, I'm not 100% sur that it will write thème
and not th\xc3\xa8me
(for instance).
I'll open a PR
Ok thanks. I'll not be able to test before beginning 2017... Hope the PR solves the problem
Version 2.1.0.dev25
Something wrong in my base file ?