Bug 353715

Summary: calendar popup ignores language locale for month/day names
Product: [Plasma] plasmashell Reporter: arne anka <kde-bugs>
Component: Digital ClockAssignee: Martin Klapetek <mklapetek>
Status: RESOLVED FIXED    
Severity: normal CC: kde, kde, plasma-bugs
Priority: NOR    
Version: 5.3.2   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screenshot showing calendar using de_DE while context menu uses the expected english (C) texts

Description arne anka 2015-10-09 11:24:57 UTC
all texts in KDE appear in English -- except the month/day names in the calendar popup of the Digital Clock widget.
obviously, the Clock widget uses the "Time" locale (de_DE) not only to correctly show the first day of week, but also, wrongly, to translate the names.
Instead it should, as all other KDE components do, use the "Region" locale (C).

i am a bit confused as to how the KDE settings or the system locales are taken into account (i got the strong impression, that it varies depending on component and maybe the moon's phase), but here are both configurations:

KDE regional settings:
Region: C
Numbers: de_DE
Time: de_DE
Currency: de_DE
Measurement Units: de_DE
Collation and Sorting: de_DE

system locale settings:
$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=C.UTF-8
LANGUAGE=en_DK:en
LC_CTYPE="C.UTF-8"
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=


Reproducible: Always
Comment 1 arne anka 2015-10-09 11:27:44 UTC
Created attachment 94906 [details]
screenshot showing calendar using de_DE while context menu uses the expected english (C) texts
Comment 2 Kai Uwe Broulik 2015-10-11 11:29:32 UTC
Looks like a Qt bug, iirc we ask it for the month names.
Comment 3 David Edmundson 2015-10-11 19:44:02 UTC
Kinda, I looked into this.

On Unix there are multiple locales used - one for text one for dates.

However, when we do QLocale's date to string - that uses the qlocale that we set for dates, not for lang - and then naturally we get translated text.

We could force it to use the locale from $LANG - but then it's technically the wrong locale
Comment 4 Martin Klapetek 2015-11-18 17:38:32 UTC
Git commit 6f3fed77d59227a9b3ec85d343ffb2443086f7fa by Martin Klapetek.
Committed on 18/11/2015 at 17:38.
Pushed by mklapetek into branch 'master'.

[calendar] Use ui language for getting the month name

Simple QDate::longMonthName(..) won't do the job as it
will return the month name using LC_DATE locale which is used
for date formatting etc. So for example, in en_US locale
and cs_CZ LC_DATE, it would return Czech month names while
it should return English ones. So here we force the first ui
language locale and take the month name from that.
REVIEW: 125705

M  +12   -1    src/declarativeimports/calendar/calendar.cpp

http://commits.kde.org/plasma-framework/6f3fed77d59227a9b3ec85d343ffb2443086f7fa