Bug 468050

Summary: Language changed to my system default even en-US set
Product: [Applications] digikam Reporter: Petr Schonmann <pschonmann>
Component: Usability-i18nAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: caulier.gilles, metzpinguin
Priority: NOR    
Version First Reported In: 8.0.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.0.0
Sentry Crash Report:
Attachments: digikam_in_czech_but_en_us_set

Description Petr Schonmann 2023-04-01 22:13:37 UTC
Created attachment 157781 [details]
digikam_in_czech_but_en_us_set

SUMMARY
***
even if i have set default language en-US in digikam i have digikam in Czech language ( system default )
***


STEPS TO REPRODUCE
1. Compiled latest digikam from git.
2. Some version from last week was ok.
3. 

OBSERVED RESULT
Language forced to system default ?
Even restart changes nothing

EXPECTED RESULT


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

ADDITIONAL INFORMATION
Comment 1 Maik Qualmann 2023-04-02 06:10:52 UTC
I can reproduce the problem, there is this message at the beginning:

kf.i18n: KCatalog being used without a Q*Application instance. Some translations won't work

https://api.kde.org/frameworks/ki18n/html/prg_guide.html#before_qapp

The question at the moment is where do we access k18n before the QApplication is created.

Maik
Comment 2 caulier.gilles 2023-04-02 06:41:08 UTC
hi Maik,

Perhaps the static strings declared in the global definitions as these ones :

https://invent.kde.org/graphics/digikam/-/blob/master/core/libs/widgets/metadata/utils/altlangstredit_p.cpp#L43

... fixed recently for KF6 build in a recent MR.

Gilles
Comment 3 Maik Qualmann 2023-04-02 06:51:51 UTC
Ah, thanks Gilles. I knew I had seen the change then.
When looking through it now, the change was collapsed in the gitlab interface due to the size.

Maik
Comment 4 Maik Qualmann 2023-04-02 07:32:49 UTC
Git commit 657d217bc7fd6e4e88c6941d0c7beb0bd4497e23 by Maik Qualmann.
Committed on 02/04/2023 at 07:31.
Pushed by mqualmann into branch 'master'.

port language code map to KLazyLocalizedString
FIXED-IN: 8.0.0

M  +1    -1    NEWS
M  +2    -2    core/libs/widgets/metadata/utils/altlangstredit.cpp
M  +358  -358  core/libs/widgets/metadata/utils/altlangstredit_p.cpp
M  +2    -1    core/libs/widgets/metadata/utils/altlangstredit_p.h

https://invent.kde.org/graphics/digikam/commit/657d217bc7fd6e4e88c6941d0c7beb0bd4497e23
Comment 5 Maik Qualmann 2023-04-02 07:44:21 UTC
If I read it correctly in the API doc, I18N_NOOP is also deprecated since KF5-5.89. So we have to replace it in digiKam soon.

Maik
Comment 6 Maik Qualmann 2023-04-02 08:01:05 UTC
Since KLazyLocalizedString is only available from KF-5.89, the question arises whether we raise the KF5 minimum version or make a compile switch?

Maik
Comment 7 caulier.gilles 2023-04-02 08:36:45 UTC
KF5 5.89 is really old now. We are at 5.104, so we can change the minimum requirement.

Gilles
Comment 8 caulier.gilles 2023-04-02 10:08:32 UTC
Petr,

AppImage bundle is updated only with last changes from Maik:

https://files.kde.org/digikam/

Please test and give us a feedback.

Best regards

Gilles Caulier
Comment 9 Petr Schonmann 2023-04-02 18:50:03 UTC
This bug is fixed in
digiKam-8.0.0-20230402T142523-x86-64-debug.appimage