https://bugs.kde.org/show_bug.cgi?id=523856
Bug ID: 523856
Summary: Lokalize adds extra newline after translator comments
Classification: Applications
Product: lokalize
Version First unspecified
Reported In:
Platform: Other
OS: Linux
Status: REPORTED
Severity: minor
Priority: NOR
Component: editor
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected], [email protected]
Target Milestone: ---
DESCRIPTION
If you add a new translator comment to an entry, Lokalize writes an extra,
empty newline after the comment in the saved PO file. This is unnecessary and
looks bad.
Note that if there is an existing comment, editing it does *not* introduce an
extra newline.
STEPS TO REPRODUCE
1. Create a PO file that looks like this:
msgid ""
msgstr ""
"Project-Id-Version: foo\n"
"Report-Msgid-Bugs-To: https://bugs.kde.org\n"
"PO-Revision-Date: 2026-08-04 17:24+0200\n"
"Last-Translator: Karl Ove Hufthammer <[email protected]>\n"
"Language-Team: Norwegian Nynorsk <[email protected]>\n"
"Language: nn\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"
msgid "Close"
msgstr "Lukk"
# Verb, ikkje substantiv
msgid "Open"
msgstr "Opna"
2. Open the PO file.
3. Add a translator comment for the first entry (click ‘Add a note…’ in the
unit pane). Write ‘foo’.
4. Edit the translator comment for the second entry so that it too says ’foo’.
5. Save the file.
OBSERVED RESULT
The new comment has an extra empty line between the translator comment and the
msgid in the resulting file. (The edited comment does not have this.)
# foo
msgid "Close"
msgstr "Lukk"
# foo
msgid "Open"
msgstr "Opna"
EXPECTED RESULT
No empty lines between the translator comment and the the msgid (or msgctxt):
# foo
msgid "Close"
msgstr "Lukk"
# foo
msgid "Open"
msgstr "Opna"
SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20260802
KDE Plasma Version: 6.7.3
KDE Frameworks Version: 6.28.0
Qt Version: 6.11.1
Kernel Version: 7.1.5-1-default (64-bit)
Graphics Platform: Wayland
ADDITIONAL INFORMATION
I don’t remember having this problem before. However, I tried bisecting in Git,
but couldn’t find where the bug was introduced (I tried going back to 2023).
Might be caused changes in an underlying library instead?
--
You are receiving this mail because:
You are watching all bug changes.