Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.3.1
-
None
Description
The Linguist tools (lupdate, lconvert) produce faulty PO files, they mangle the context and source comments into one string, making it impossible to translate the current KDE Qt-based frameworks (examples taken from the kcompletion framework below).
Example 1:
d->clearButton->setToolTip(tr("Clear text", "@action:button Clear current text in the line edit"));
produces:
#: /home/ltinkl/git/plasma-next-setup-script/kcompletion/src/klineedit.cpp:224
msgctxt "KLineEdit|@action:button Clear current text in the line edit"
msgid "Clear text"
msgstr ""
Example 2:
KHistoryComboBox::tr("Clear &History")
produces:
#: /home/ltinkl/git/plasma-next-setup-script/kcompletion/src/khistorycombobox.cpp:203
msgctxt "KHistoryComboBox|"
msgid "Clear &History"
msgstr ""
One problem is the trailing "|" character when no comment (disambiguation) is given, another problem is putting that comment behind the context. The msgctxt has to match the source code context exactly and the comment has to be put before the entry as a plain comment. When converting such PO file back to TS with lconvert, the context is lost.
Attachments:
kcompletion.ts : well formed TS files, with correct contexts preserved
kcompletion.po : wrongly mangled context and comment when extracting the strings using "lupdate *.cpp -ts kcompletion.po"
kcompletion_converted.po: wrongly mangled context and comment when converting the file using "lconvert-qt5 -i kcompletion.ts -o kcompletion_converted.po"