[Libreoffice-commits] core.git: solenv/bin
Caolán McNamara
caolanm at redhat.com
Fri Jul 21 13:01:11 UTC 2017
solenv/bin/interim-update-module-for-gettext | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit b761db42f542b2627480db47edfb656b47fffd04
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 21 13:58:21 2017 +0100
fix up some mismatching msgstr vs msgid trailing newlines
these are broken (from msgfmt's perspective anyway) already
in our translations and pootle warns about them
Change-Id: I9ce7c651273e334ecb92a592397886e2b95907da
diff --git a/solenv/bin/interim-update-module-for-gettext b/solenv/bin/interim-update-module-for-gettext
index 0fe222504273..02508032aea3 100755
--- a/solenv/bin/interim-update-module-for-gettext
+++ b/solenv/bin/interim-update-module-for-gettext
@@ -64,6 +64,12 @@ if npos > 0:
keyid = entry.msgctxt + '|' + entry.msgid
comments[-1] = polib.genKeyId(keyid.encode('utf-8'))
entry.comment = "\n".join(comments)
+ if (len(entry.msgid) and len(entry.msgstr)):
+ if (entry.msgid[-1] == '\n' and entry.msgstr[-1] != '\n'):
+ entry.msgstr = entry.msgstr + '\n'
+ elif (entry.msgid[-1] != '\n' and entry.msgstr[-1] == '\n'):
+ entry.msgstr = entry.msgstr[:-1]
+
else:
messages = polib.POFile()
messages.metadata = {
More information about the Libreoffice-commits
mailing list