[lokalize] [Bug 523856] New: Lokalize adds extra newline after translator comments

"Karl Ove Hufthammer" <[email protected]> Tue, 04 Aug 2026 15:39:09 +0000
Newsgroups gmane.comp.kde.devel.bugs
Message-ID <[email protected]/>
https://bugs.kde.org/show_bug.cgi?id=3D523856

            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 a=
nd
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=3DUTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3D2; plural=3Dn !=3D 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 =E2=80=98Add a note=
=E2=80=A6=E2=80=99 in the
unit pane). Write =E2=80=98foo=E2=80=99.
4. Edit the translator comment for the second entry so that it too says =E2=
=80=99foo=E2=80=99.
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=E2=80=99t remember having this problem before. However, I tried bisec=
ting in Git,
but couldn=E2=80=99t find where the bug was introduced (I tried going back =
to 2023).
Might be caused changes in an underlying library instead?

--=20
You are receiving this mail because:
You are watching all bug changes.=