Java printf format strings in lookandfeel translation file

Karl Ove Hufthammer karl at huftis.org
Sat Mar 13 14:14:38 GMT 2021


In the file plasma-workspace/plasma_lookandfeel_org.kde.lookandfeel.pot, 
there are several strings marked ‘java-printf-format’. Example:

#: contents/components/Battery.qml:54
#, java-printf-format
msgid "Battery at %1%"
msgstr ""

For Norwegian Nynorsk, and probably other languages too, there needs be 
space between the number and the percentage. But if I write

msgstr "Batterinivå %1 %"

I get an error message (when running msgfmt):

    'msgstr' is not a valid Java printf format string, unlike 'msgid'.
    Reason: In the directive number 1, the character ' ' is not a valid
    conversion specifier.

How are we supposed to write the msgstr to get a valid PO file? And why 
are *Java* printf strings used inside QML files?

This file and kdeconnect-kde/plasma_applet_org.kde.kdeconnect.pot (which 
has the same problem) are the only two POT files that contain these 
types of strings.


-- 
Karl Ove Hufthammer



More information about the kde-i18n-doc mailing list