Clock applet displaying time and date in wrong locale

Bug #820187 reported by Johan Sjölin
48
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Ayatana Design
New
Undecided
Unassigned
Indicator Date and Time
Confirmed
Low
Unassigned

Bug Description

I have set the language in Ubuntu to English (United States) and the regional formats to Swedish standards. The clock applet doesn't fully adhere to these settings. In the unactivated state, it shows the time and date in American format.

Revision history for this message
Johan Sjölin (johsjo) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, could you run "locale" and "env | grep LANG" on a command line and copy the output to the bug?

affects: indicator-applet → indicator-datetime
Changed in indicator-datetime:
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
Johan Sjölin (johsjo) wrote :

Output from "locale":

LANG=sv_SE.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES=en_US.UTF-8
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=

Output from "env | grep LANG":

LANG=sv_SE.UTF-8
GDM_LANG=en_US
LANGUAGE=en_US:en

Revision history for this message
Sebastien Bacher (seb128) wrote :

seems similar to bug #819738, what locale do you select on gdm?

Revision history for this message
Johan Sjölin (johsjo) wrote :

In the login screen? English (United States).

Revision history for this message
Bowmore (bowmore) wrote :

After som research I found out the following:

At a new installation (oneiric beta1, issued Wed 31 August) the env LANGUAGE is unset. This results in English in the panel while the drop down menu is correctly all in Swedish.

$ locale
LANG=sv_SE.UTF-8
LANGUAGE=
LC_CTYPE="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES="sv_SE.UTF-8"
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=

$ env | grep LANG
LANG=sv_SE.UTF-8

Deactivating and then reactivation Swedish again in System Settings > Language Support fixes it for the indicator and locales then are

$ locale
LANG=sv_SE.UTF-8
LANGUAGE=sv:en
LC_CTYPE=sv_SE.UTF-8
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE=sv_SE.UTF-8
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES=sv_SE.UTF-8
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=

$ env | grep LANG
LANG=sv_SE.UTF-8
LANGUAGE=sv:en

However, creating a new user with English as preferred language gives

$ locale
LANG=sv_SE.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE=en_GB.UTF-8
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE=en_GB.UTF-8
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES=en_GB.UTF-8
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=

$ env | grep LANG
LANG=sv_SE.UTF-8
LANGUAGE=en_GB:en

but the drop down menu is a mix of Swedish and English!

Panel: Wed 31 Aug 21.31
Drop down menu:
Wednesday, 31 August 2011
augusti 2011
mån tis ons tor fre lör sön
...

Time & Date Settings...

Here, the calendar part wrongly is in Swedish! Might be a language and regional format confusion.

Revision history for this message
Bowmore (bowmore) wrote :

Yes, it's a language and regional format confusion.

Changing Regional format to English "fixes" the language in the drop down menu. Thus, the language in the calendar (name of month and day)) relies on wrong locale.

Revision history for this message
Javier Jardón (jjardon) wrote :

Yeah, seems to be a inconsistent behaviour here.

So, I'd like to ask what would be the correct aproach here:
For example, if you select English language and Swedish locales, both the indicator and the drop menu should be in Swedish, rigth?

Revision history for this message
Javier Jardón (jjardon) wrote :

This is what happen in evolution for example, when you have the environment in english, and the regional format in Swedish, all the dates are displayed in Swedish

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

I don't have LANGUAGE set after a vanilla installation using all-finnish language, and the month on the panel is now 'Septemberta' (note the 'ta', comes from the partitive case of 'syyskuu'(September), 'syyskuuTA').

I wonder if indicator-datetime has any need to use LANGUAGE at all, at least not for the month names?

Revision history for this message
Bowmore (bowmore) wrote :

@Timo Aaltonen
>So, I'd like to ask what would be the correct aproach here:
>For example, if you select English language and Swedish locales, both the
>indicator and the drop menu should be in Swedish, rigth?

Well, I expected English both in the indicator and the drop down menu, and partly it is.

>This is what happen in evolution for example, when you have the environment
in english, and the regional format in Swedish, all the dates are displayed
>in Swedish

Yes, both rely on LC_TIME

Maybe there is no straight forward solution to this problem but a new design rule. To me LC_TIME points to date and time format but not whether August should be written in English or Swedish. Most LC_* handles formatting.

Anyway, one workaround is to add LC_TIME to the file ~/.profile, e.g for English (UK) this line is
export LC_TIME="en_GB.UTF-8"

The drawback is that date and time formats changes to achieve English for month and weekdays.

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

These are useful to read:

http://www.gnu.org/s/hello/manual/gettext/Locale-Environment-Variables.html
http://www.gnu.org/s/hello/manual/gettext/The-LANGUAGE-variable.html

So the LANGUAGE variable trumps LANG, and if it has "en" (though LANG has something else) then the program should use 'en' translations, not a mixture of 'en' and something else.

But what indicator-datetime does wrong is that if LANGUAGE is not set, it doesn't just use what LANG has, but something completely different, as I pointed out. (and if I set LANGUAGE=fi, all is fine here)

Revision history for this message
Javier Jardón (jjardon) wrote :

@Timo, could you run "locale" and "env | grep LANG" on a command line and copy the output to the bug?

Revision history for this message
Timo Aaltonen (tjaalton) wrote :

:: tjaalton@nexus6:/tmp/jockey-0.9.4> locale |grep LANG
LANG=fi_FI.UTF-8
LANGUAGE=

like I said.. :)

Thomas Hood (jdthood)
Changed in indicator-datetime:
status: Incomplete → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.