Bug 382195

Summary: Not all installed languages are visible on Windows
Product: [Unmaintained] kdelibs Reporter: Ralf Habacker <ralf.habacker>
Component: klocaleAssignee: Chusslove Illich <caslav.ilic>
Status: RESOLVED WORKSFORME    
Severity: normal CC: christoph, trustno12003
Priority: NOR    
Version: 4.14.0   
Target Milestone: ---   
Platform: Other   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 403474    

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.
Comment 9 Christoph Cullmann 2024-05-01 20:37:37 UTC
Hi,

the KDE libaries and applications version 4.x are obsolete and got replaced with Frameworks 5 and now 6 based variants that are still maintained.

The issue in this bug doesn't seem to happen for me with these versions.