Bug 489181 - X-KDE-Keywords[de] is missing in many (all?) kcm json files
Summary: X-KDE-Keywords[de] is missing in many (all?) kcm json files
Status: RESOLVED FIXED
Alias: None
Product: i18n
Classification: Translations
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-25 13:59 UTC by cwo
Modified: 2024-09-12 08:30 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cwo 2024-06-25 13:59:37 UTC
SUMMARY

systemsettings uses the X-KDE-Keywords field of the kcm_kcmname.json file to populate the list of search terms that will allow finding that kcm though the search/filter field. For all kcms that I have looked at, the German entry is completely missing, and search by keywords that do not otherwise appear in the file does not work. (I'll use kcm_screenedges.json (/kwin/src/kcms/screenedges/) as an example as this is where I noticed it first)

STEPS TO REPRODUCE
1. Open SystemSettings with language set to German
2. Type "ecke" into the search field (top left)

OBSERVED RESULT

Empty list of results

EXPECTED RESULT

Screen Edges kcm is offered as a search result, the same way it is with language set to English if you search for "corner". 

SOFTWARE/OS VERSIONS

Tested in Tuxedo OS (latest, fully upgraded), but the entry seems to be missing in git master and I couldn't find it in the commit history.

I have not checked all kcms manually, but it does affect the ones I tested - for example, "Doppel(klick)" does not find the mouse kcm, while "double (click)" finds it if the language is set to English. The English matches do work in German, though, so "Baloo" or "Index" work in German to find the desktop search kcm, as they are the terms as in English.
Comment 1 cwo 2024-06-27 21:47:19 UTC
After further investigation (and with help from @tsdgeos):

- The translation for keywords is missing for many languages. I can't confirm it, but it seems to me like the languages that do have the field do not get updated with changes to the English version
- The German translation does have fields corresponding to these keywords, marked as outdated, in the po for the desktop files
- Apparently the kcm metadata format was changed from .desktop files to .json at some point (between 2020 and 2022? couldn't quite find it), and this broke i18n for these files.
- extractrc can't extract the X-KDE-Keywords strings from the json files, as they're not contained in the Kplugin section
- I have no idea why a remnant of the keyword translations remains for some languages but not others - possibly manual intervention?
- Keyword searches in systemsettings are likely partially or completely broken for many languages
Comment 2 Albert Astals Cid 2024-06-27 22:24:27 UTC
extractrc is not involved here
Comment 3 Albert Astals Cid 2024-06-27 22:26:31 UTC
Alex you did the desktop to json translation of most of these things.

Can you please work on making these fields extractable and mergeable back?

We can either use extrajsontranslationkeys (which will be annoying because developers will obviously forget about it) or just possibly hardcode it in scripty's json file handling.
Comment 4 Alexander Lohnau 2024-09-12 08:30:58 UTC
Git commit 36d0fd64e9d69912bc9c36eafb53ecd1e7616385 by Alexander Lohnau.
Committed on 11/09/2024 at 19:50.
Pushed by aacid into branch 'master'.

Add X-KDE-Keywords as default for extra translation values

M  +3    -3    createjsoncontext.py
M  +2    -2    filljsonfrompo.py
M  +1    -0    jsontranslationcommon.py

https://invent.kde.org/sysadmin/l10n-scripty/-/commit/36d0fd64e9d69912bc9c36eafb53ecd1e7616385