Re: Missing parts of translatable string in ‘Welcome’ app
Karl Ove Hufthammer
karl at huftis.org
Wed Jul 5 10:34:32 BST 2023
See the old discussion quoted below. I have now found a few more strings
with the same problem. The QML file at
https://invent.kde.org/libraries/kirigami-addons/-/blob/master/src/mobileform/AboutKDE.qml#L99
has this multiline string:
text: i18nd("kirigami-addons", "Software can always be improved, and
the KDE team is ready to do so. However, you - the user - must tell
us when something does not work as expected or could be done better.\n
KDE has a bug tracking system. Use the button below to file a bug,
or use the program's About page to report a bug specific to this
application.\n
If you have a suggestion for improvement then you are welcome to use
the bug tracking system to register your wish. Make sure you use the
severity called \"Wishlist\".")
But the extracted string in the translation file (kirigami-addons.pot)
only contains the first paragraph/line:
msgid "Software can always be improved, and the KDE team is ready to
do so. However, you - the user - must tell us when something does
not work as expected or could be done better.\n"
Since the two strings don’t match, and the string is always shown in
English in the UI.
There are multiple similar strings in the above file with the same
problem. And probably strings in other files too.
The problem is that strings like these *seem* to work, i.e., they are
shown in UI as multiline strings. And they generate valid (but
different) strings in .pot file. So it’s very difficult to discover that
there’s a problem at all.
Is there a way to fix this once and for all, perhaps by changing the
L10N extractor to handle such (not really valid?) multiline strings, or
by changing the compiler toolchain or some automatic tests to *reject*
such strings?
Karl
Luigi Toscano skreiv 21.01.2023 15:23:
> Karl Ove Hufthammer ha scritto:
>> In the new ‘Welcome’ app, there’s a long, multi-line string that begins with
>> the text ‘KDE Connect lets you integrate your phone with your computer in
>> various ways:’
>> https://invent.kde.org/plasma/plasma-welcome/-/blob/master/src/contents/ui/pages/PowerfulWhenNeeded.qml#L173-181
>>
>>
>> However, in the corresponding POT file (plasma-welcome.pot), only the first
>> line of the string is present. And if we translate it, the translation is not
>> being used (as it doesn’t match the original string).
>>
>> The string in the .qml file was added in 2022, and the POT file last updated
>> 2023-01-19, so it doesn’t seem to be a case of an outdated POT file.
>>
>> The .qml file uses a normal xi18nc() call, which looks correct. Any ideas
>> what’s causing the problem?
> (assing plasma-devel in CC):
>
> I suspect, but please others correct me, this may be related to the handling
> of strings in Javascript/QML, as previously discussed here:
> https://phabricator.kde.org/D24073 andhttps://phabricator.kde.org/T11721
>
> If that's the case, the strings should be reformatted accordingly, either as a
> long string on a single line, or using the format:
>
> i18n("foo \
> bar \
> baz")
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-i18n-doc/attachments/20230705/550f5874/attachment.htm>
More information about the kde-i18n-doc
mailing list