Bug 413123 - Cannot select target languge in Project > Configure project > General > Target language
Summary: Cannot select target languge in Project > Configure project > General > Targe...
Status: REPORTED
Alias: None
Product: lokalize
Classification: Applications
Component: general (show other bugs)
Version: 19.08.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-18 00:58 UTC by boput
Modified: 2022-12-09 14:28 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?