Kaydet (Commit) b761db42 authored tarafından Caolán McNamara's avatar Caolán McNamara

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
üst 7a02d453
......@@ -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 = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment