accountsservice does not set language fully

Bug #1159496 reported by Walter Garcia-Fontes
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
accountsservice (Ubuntu)
Fix Released
Low
Gunnar Hjalmarsson

Bug Description

I have updated my system and chose "Catalan" language as my locale everywhere. If I enter "locale" at a command line, I get the following:

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

Notice the wrong string in language and and the empty string in LC_ALL. Some programs which are localized in Catalan don't start in Catalan, unless I redefine the variable LANGUAGE to:

LANGUAGE= ca:ca_ES:ca

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: locales 2.13+git20120306-9
ProcVersionSignature: Ubuntu 3.8.0-14.24-generic 3.8.4
Uname: Linux 3.8.0-14-generic x86_64
ApportVersion: 2.9.2-0ubuntu2
Architecture: amd64
Date: Sun Mar 24 20:13:39 2013
InstallationDate: Installed on 2012-05-31 (297 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: langpack-locales
UpgradeStatus: Upgraded to raring on 2013-02-28 (24 days ago)

Revision history for this message
Walter Garcia-Fontes (walter-garcia) wrote :
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Hi Walter, and thanks for your help to make Ubuntu better by reporting this issue. (I don't think it has anything to do with langpack-locales, though.)

Anyway, I'm deeply involved in this problem area, and have some questions.

First, to better understand the problem, I'm interested in the contents of two files. Can you please let us know the output from these commands:

  cat /etc/default/locale

  cat ~/.pam_environment

On 2013-03-24 20:17, Walter Garcia-Fontes wrote:
> I have updated my system and chose "Catalan" language as my locale
> everywhere.

Were the programs you mention displayed in Catalan before the update?

Exacly what did you do when updating? Are you referring to the distupgrade 24 days ago?

> Notice the wrong string in language and and the empty string in LC_ALL.

It's not "wrong" per se. LC_ALL is not supposed to be set.

> Some programs which are localized in Catalan don't start in Catalan,
> unless I redefine the variable LANGUAGE to:
>
> LANGUAGE= ca:ca_ES:ca

That's the same as just saying LANGUAGE=ca_ES

If ca_ES works but not ca for some programs, I suppose that you have a /usr/share/locale/ca_ES folder on your system with translations for those programs. And if so, setting the language to your liking using Language Support should populate LANGUAGE in a way that works; e.g. like

LANGUAGE="ca_ES:en"

Changed in langpack-locales (Ubuntu):
status: New → Incomplete
Revision history for this message
Walter Garcia-Fontes (walter-garcia) wrote :

$ cat /etc/default/locale

LANG="ca_ES.UTF-8"
LC_NUMERIC="ca_ES.UTF-8"
LC_TIME="ca_ES.UTF-8"
LC_MONETARY="ca_ES.UTF-8"
LC_PAPER="ca_ES.UTF-8"
LC_IDENTIFICATION="ca_ES.UTF-8"
LC_NAME="ca_ES.UTF-8"
LC_ADDRESS="ca_ES.UTF-8"
LC_TELEPHONE="ca_ES.UTF-8"
LC_MEASUREMENT="ca_ES.UTF-8"
LANGUAGE="ca:en_US:en"

$ cat ~/.pam_environment

LANGUAGE=ca:en_US:en
LANG=ca_ES.UTF-8
LC_NUMERIC=ca_ES.UTF-8
LC_TIME=ca_ES.UTF-8
LC_MONETARY=ca_ES.UTF-8
LC_PAPER=ca_ES.UTF-8
LC_NAME=ca_ES.UTF-8
LC_ADDRESS=ca_ES.UTF-8
LC_TELEPHONE=ca_ES.UTF-8
LC_MEASUREMENT=ca_ES.UTF-8
LC_IDENTIFICATION=ca_ES.UTF-8
PAPERSIZE=a4

On your other questions:
> Were the programs you mention displayed in Catalan before the update?

They were in previous versions of Ubuntu. This is a program I compile myself and in previous versions once I had everything localized in Catalan in Ubuntu it would show up correctly in Catalan. Now unless I change the LANGUAGE variable as I explained above they will not show in Catalan.

> Exacly what did you do when updating? Are you referring to the distupgrade 24 days ago?

I was just referring to upgrading to 13.04 which I did some weeks ago.

> I suppose that you have a /usr/share/locale/ca_ES folder on your system with translations for those programs.

The strings for this program are actually in :

/usr/local/share/locale/ca_ES/LC_MESSAGES/

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

Thanks for the info.

Can you please set the language to your liking by using Language Support. Then we'll know if Language Support does the right thing now. (I think it does.)

The other question is how the string "ca:en_US:en" ended up in LANGUAGE. I see that string in both ~/.pam_environment and /etc/default/locale. It shouldn't have happened automatically when you upgraded to 13.04.

The only thing I can think of is that you set the language via one of the UIs for doing so at a point of time when the program you mention was (temporarily) not installed, i.e. when /usr/local/share/locale/ca_ES was not present.

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

Wait, now I see what the problem is. Since you compile the program in question yourself, the path to the .mo file(s) is

  /usr/local/share/locale
       =====

while accountsservice only checks out

  /usr/share/locale

Suddenly I understand the need to edit ~/.pam_environment manually.

affects: langpack-locales (Ubuntu) → accountsservice (Ubuntu)
Changed in accountsservice (Ubuntu):
importance: Undecided → Low
status: Incomplete → Triaged
summary: - Locales does not set language fully
+ accountsservice does not set language fully
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :
tags: added: patch
Changed in accountsservice (Ubuntu):
assignee: nobody → Gunnar Hjalmarsson (gunnarhj)
status: Triaged → In Progress
Revision history for this message
Walter Garcia-Fontes (walter-garcia) wrote :

Thanks Gunnar, excellent you spotted it!

Revision history for this message
Daniel Holbach (dholbach) wrote :

Good work. Uploaded.

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

This bug was fixed in the package accountsservice - 0.6.29-1ubuntu8

---------------
accountsservice (0.6.29-1ubuntu8) raring; urgency=low

  * debian/patches/0009-language-tools.patch:
    Take /usr/local/share/locale into account when generating the list
    of language options (LP: #1159496).
 -- Gunnar Hjalmarsson <email address hidden> Fri, 29 Mar 2013 06:19:34 +0100

Changed in accountsservice (Ubuntu):
status: In Progress → Fix Released
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.