Bug 413123

Summary: Cannot select target languge in Project > Configure project > General > Target language
Product: [Applications] lokalize Reporter: boput <bozidarp>
Component: generalAssignee: Simon Depiets <sdepiets>
Status: REPORTED ---    
Severity: normal CC: aacid, jlp, kdelibs-bugs, shafff
Priority: NOR    
Version: 19.08.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description boput 2019-10-18 00:58:20 UTC
SUMMARY
Cannot select target language in "Configure project". In fact cannot select any language, as the bar is empty, cannot be clicked.

STEPS TO REPRODUCE
1. Menu > Project > Configure project > General > Target language
2. Nothing can be selected, I need Croatian as target language.
3. In main window, when mouse hover above space for translated strings, tip tool reports "American English", all Croatian words are "misspelled", as Lokalize thinks they are English word but misspelled.

OBSERVED RESULT
Cannot select target language

EXPECTED RESULT
Be able to select target language and be able to use Croatian spell check.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
My PC is running Windows 10, but is configured as US version. I have added Croatian keyboard which works perfectly in Word, also spelling is correct in the Word documents.
Comment 1 Jure Repinc 2022-12-09 10:50:47 UTC
I get the same problem here. Every place where you can select a language (also when creating a new translation memory) only US English (en_US) is available but no other language. This is with Lokalize 22.12.0, openSUSE Tumbleweed 20221206, Plasma 5.26.4, Frameworks 5.100.0, Qt 5.15.7, X11.

I have been trying to find what the problem is and if I correctly figured it out, the languages list is retrieved by KLanguageName::allLanguageCodes() in src/common/languagelistmodel.cpp
https://invent.kde.org/sdk/lokalize/-/blob/master/src/common/languagelistmodel.cpp#L53

What this function does (part of KConfigWidgets from Frameworks)
https://invent.kde.org/frameworks/kconfigwidgets/-/blob/master/src/klanguagename.cpp#L72
it searches through all the locale directories, e.g. in /usr/share/locale/* and looks for locale subdirectories which contain kf5_entry.desktop (containing all translations of specific locale).

What I can see is that on my OpenSUSE, Kubuntu 22.10 and Gentoo systems, only the en_US locale directory contains this kf5_entry.desktop file. All others so not, so only this locale is in the end available for selection.

I would expect at least Slovenian (sl) to have this file, since I also have Slovenian locales/translations installed on these computers. It looks like the package responsible for providing this should be kconfigwidgets but there is only one provided for en_US. It looks like there is also some code in CMakeLists.txt of KConfigWidgets that should install those files but yeah they appear not to be there so they are not installed
https://invent.kde.org/frameworks/kconfigwidgets/-/blob/master/CMakeLists.txt#L83

So to sum it up the lack of languages is probably because /usr/share/locale/*/kf5_entry.desktop are missing. To me it looks like the scripts that process translations in SVN and update/add the relevant files in the sources of KConfigWidgets are not working properly so these files are missing.

Maybe this bug report should be moved to frameworks-kconfigwidgets/general or  i18n/general product?