Regional Formats

Bug #820333 reported by hardik
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gdm (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

When i change the language at the login time its not changing the language in the Regional Formats of the Language setting in Ubuntu 11.04.

Tags: ubuntu-unr
Omer Akram (om26er)
affects: unity (Ubuntu) → ubuntu
hardik (hardik-soni)
tags: added: ubuntu-unr
Revision history for this message
hardik (hardik-soni) wrote :

I am facing a very strange behavior in Ubuntu 11.04,
As in normal cases when ever we change language at the time of login its change its locale variable and it use to set that selected language as the default language in
"Text" tab of the Language Support up till the Ubuntu version 10.10,
But in Ubuntu 11.04 its not the case.
When ever we change the language at the time of login at that time the language is not set in the "Regional Formats" of the Language Support.So it is not changing
the LANG variable of the "locale" command in th Ubuntu.

So is it a bug or the change in behavior for the Ubuntu 11.04.

Regards,
Hardik

Changed in ubuntu:
status: New → Confirmed
Revision history for this message
Jay Donovan (jadonovan) wrote :

When Spanish is selected at the 11.04 login, the environment variable LANG doesn't reflect this - echo $LANG still gives en_US.LTF-8

Revision history for this message
hardik (hardik-soni) wrote :

Its not only for the Spanish Language its for all the languages on Ubuntu 11.04.
May be its the Bug in Ubuntu 11.04 or the change in specification.

Alan Bell (alanbell)
affects: ubuntu → gdm (Ubuntu)
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Thanks for your effort to improve Ubuntu by reporting this observation. Language and regional formats are separate things, though, and in Natty the LANG variable represents the regional formats settings only. The described change in behavior is intentional and not a bug. Please click the "Help" button from the Language Support window for further info on how it's intended to work.

Is this sufficient as a clarification?

Changed in gdm (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Jay Donovan (jadonovan) wrote :

Many thanks for the response - unfortunately I'm looking for a way to programmatically determine the system language so my app can present itself appropriately.

The app actually uses Qt's QLocale::system().name() and this was working fine in 10.10 but is returning "en_US" now regardless of the system language.

Could you suggest an alternative solution to obtaining the system language programmatically?

Thanks again,
Jay

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Sure. To me the term "system language" is the system wide language that is used at startup and on the login screen, so I assume that you actually mean what I usually refer to as the "user language" which may differ between multiple users on a system.

If it's a locale name you need, check first the LC_MESSAGES environment variable, and if it's not set, use the value of the LANG variable. This works in Natty and will work in Oneiric, but might change after that.

HTH - let me know if it was something else you were after.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Btw, shouldn't you make your app use gettext for selecting the display language?

Revision history for this message
hardik (hardik-soni) wrote :

Many Thanks for you quick response Gunnar,
Yes what you said to use LC_MESSAGE and if it is not set then use the LANG variable very true i tried out this thing but the only problem is that LC_MESSAGE is not in the lower versions of the Ubuntu means in 10.04 or in Fedora machines by the envirnoment variable.e.g.. env | grep MESS

As well as i tried to use the LANGUAGE environment variable also but it only gives us the language name not the Country code with that Language.So even i get the LANGUAGE correctly but wont able to get the correct Country Code for that Particular Language and if i use LC_MESSAGE its not present in the lower versions.

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@hardik
There are a few help files that you problably will find useful. They are currently available in a branch I suggest be merged into the accountsservice package. This is the patch: http://bazaar.launchpad.net/~gunnarhj/ubuntu/oneiric/accountsservice/lang-to-profile/view/head:/debian/patches/1002-language-tools.patch

When the merge proposal has been uploaded - or if you build and install the branch locally - the files reside in the /usr/share/language-tools folder. Check out the "language2locale" script.

Revision history for this message
Jay Donovan (jadonovan) wrote :

Hi Gunnar,

tried to access the url but no joy. Is it still current?

Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

@Jay
The merge proposal was uploaded, so I deleted that branch. On an updated Oneiric the help files now resides in /usr/share/language-tools.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for gdm (Ubuntu) because there has been no activity for 60 days.]

Changed in gdm (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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