Bug 382195 - Not all installed languages are visible on Windows
Summary: Not all installed languages are visible on Windows
Status: CONFIRMED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: klocale (show other bugs)
Version: 4.14.0
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Chusslove Illich
URL:
Keywords:
Depends on:
Blocks: 403474
  Show dependency treegraph
 
Reported: 2017-07-10 11:04 UTC by Ralf Habacker
Modified: 2019-02-20 14:40 UTC (History)
1 user (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 Ralf Habacker 2017-07-10 11:04:14 UTC
On running the 4.8.1 Windows snapshots provided with bug 380075 not all languages are visible in the kmymoney gui. On a german Windows 7 it turned out that only english and german are visible.

How to reproduce:
1. download and unpack portable snapshot mentioned at bug 380075
2. start kmymoney.exe from the bin dir
3. select Help->"Switch application language" and choose 'Italian'
4. restart kmymoney 

What happens ?
kmymoney gui has german gui

What is expected ?
kmymoney gui should be translated into the requested language
Comment 1 Ralf Habacker 2017-07-10 11:47:03 UTC
https://github.com/KDE/kdelibs/blob/KDE/4.14/kdecore/localization/klocale_win.cpp#L30 indicates that on Windows KDE applications are bound to the language of the windows Gui.

To verify that language selection for other language beside german works too it would be nice if people having a Windows >= 7 system with other gui language would check this on there local workstation.
Comment 2 Ralf Habacker 2017-07-10 20:14:27 UTC
KMymoney 4.8.0 installer on Windows shows the same behavior which confirms the assumption made in comment 1
Comment 3 Ralf Habacker 2018-01-15 20:14:00 UTC
*** Bug 388906 has been marked as a duplicate of this bug. ***
Comment 4 Ralf Habacker 2018-02-20 07:44:46 UTC
Looking at the implementation of KLocale on Windows shows that there is currently no support for choosing a different language beside the users default language (see https://cgit.kde.org/kdelibs.git/tree/kdecore/localization/klocale_win.cpp?h=KDE/4.14#n39)

A forward look to KF5: 
1. The issue has not been fixed in the KF5 variant of KLocale (https://cgit.kde.org/kdelibs4support.git/tree/src/kdecore/klocale_win.cpp#n39)

2. The Qt equivalent class QLocale is also limited to the default language of the current user (see https://code.woboq.org/qt5/qtbase/src/corelib/tools/qlocale_win.cpp.html#171)
Comment 5 Ralf Habacker 2019-01-18 11:09:55 UTC
(In reply to Ralf Habacker from comment #4)
> Looking at the implementation of KLocale on Windows shows that there is
> currently no support for choosing a different language beside the users
> default language (see
> https://cgit.kde.org/kdelibs.git/tree/kdecore/localization/klocale_win.
> cpp?h=KDE/4.14#n39)


The current implementation inits a locale id by 

 m_winLocaleId = GetUserDefaultLCID();
 
and later use this with in QString KLocaleWindowsPrivate::windowsLocaleValue( LCTYPE key ) const to access locale related values identified by this locale id (https://cgit.kde.org/kdelibs.git/tree/kdecore/localization/klocale_win.cpp?h=KDE/4.14#n68).

A change would req
Comment 6 Ralf Habacker 2019-01-18 11:11:39 UTC
(In reply to Ralf Habacker from comment #5)
> A change would req
A change would require to change https://cgit.kde.org/kdelibs4support.git/tree/src/kdecore/klocale_win.cpp#n35 to get a locale id from given language and country.
Comment 7 Ralf Habacker 2019-01-21 19:07:47 UTC
It has been tried to use the unix related klocale implementation (klocale_unix.cpp ) on Windows too. 

After choosing a language different from the system language in kmymoney help menu, the splashscreen is shown in english, but not the expected language. The ui is still bound to the system language.
Comment 8 Ralf Habacker 2019-02-20 14:40:52 UTC
Also using the klocale unix implementation 'klocale_unix.cpp' instead of 'klocale_win.cpp' does not solve the problem. There is more analysis required.