login only offers japanese environment

Asked by Rolf Leggewie on 2014-03-23

After upgrading from precise to trusty lightdm only offers to log in to a Japanese environment now (lightdm login screen, the pulldown only has "ja" on offer). I looked around but could not spot why this would be.

$ sudo rgrep -i ja_JP /etc/
Binary file /etc/.git/index matches
/etc/scim/config:/Hotkeys/FrontEnd/Trigger/ja_JP = Zenkaku_Hankaku,Alt+grave,Control+space
/etc/.etckeeper:maybe chmod 0755 './X11/ja_JP.UTF-8'
/etc/.etckeeper:maybe chmod 0755 './X11/ja_JP.UTF-8/app-defaults'
/etc/.etckeeper:maybe chmod 0644 './X11/ja_JP.UTF-8/app-defaults/TiMidity'
/etc/.etckeeper:maybe chmod 0755 './X11/ja_JP.eucJP'
/etc/.etckeeper:maybe chmod 0755 './X11/ja_JP.eucJP/app-defaults'
/etc/.etckeeper:maybe chmod 0644 './X11/ja_JP.eucJP/app-defaults/TiMidity'
/etc/locale.alias:japanese ja_JP.eucJP
/etc/locale.alias:japanese.euc ja_JP.eucJP
/etc/locale.alias:ja_JP ja_JP.eucJP
/etc/locale.alias:ja_JP.ujis ja_JP.eucJP
/etc/locale.alias:japanese.sjis ja_JP.SJIS
/etc/wwwoffle/namazu/namazurc:## Lang: Set the locale code such as `ja_JP.eucJP', `ja_JP.SJIS',
/etc/X11/xinit/xinput.d/default:# Japanese ja_JP* kinput2 "@im=kinput2" Shift-Space

$ ll /etc/X11/
total 92
lrwxrwxrwx 1 root root 13 Mar 2 2010 X -> /usr/bin/Xorg
-rwxr-xr-x 1 root root 709 Apr 1 2010 Xreset
drwxr-xr-x 2 root root 4096 Mar 22 20:57 Xreset.d
drwxr-xr-x 2 root root 4096 Mar 22 20:57 Xresources
-rwxr-xr-x 1 root root 3730 Feb 19 2010 Xsession
drwxr-xr-x 2 root root 4096 Mar 23 14:07 Xsession.d
-rw-r--r-- 1 root root 265 Feb 19 2010 Xsession.options
-rw------- 1 root root 601 Mar 2 2010 Xwrapper.config
drwxr-xr-x 2 root root 4096 Mar 23 14:41 app-defaults
drwxr-xr-x 2 root root 4096 Nov 19 2012 cursors
-rw-r--r-- 1 root root 18 Dec 24 01:06 default-display-manager
drwxr-xr-x 2 root root 4096 Mar 23 14:41 fluxbox
drwxr-xr-x 7 root root 4096 Mar 3 2010 fonts
drwxr-xr-x 3 root root 4096 Mar 23 14:45 ja_JP.UTF-8
drwxr-xr-x 3 root root 4096 Mar 23 14:45 ja_JP.eucJP
lrwxrwxrwx 1 root root 14 Mar 3 2010 openbox -> ../xdg/openbox
-rw-r--r-- 1 root root 17394 Feb 19 2010 rgb.txt
drwxr-xr-x 3 root root 4096 Mar 23 01:41 xinit
drwxr-xr-x 2 root root 4096 Nov 5 23:01 xkb
-rw-r--r-- 1 root root 270 Feb 1 11:05 xorg.conf.failsafe
drwxr-xr-x 2 root root 4096 Mar 22 20:57 xsm

$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
LC_MESSAGES="C"

I thought that maybe this behaviour is due to the ja_JP folders inside /etc/X11 and those belong to timidity.

$ dpkg -S /etc/X11/ja_JP.*
timidity: /etc/X11/ja_JP.UTF-8
timidity: /etc/X11/ja_JP.eucJP

The strange (and upsetting) thing is that this even overrides an explicit setting I have made.

$ cat ~/.environment
#LANGUAGE="en_US:en"
LANG="de_DE.UTF-8"
LC_MESSAGES="C"

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu language-selector Edit question
Assignee:
Gunnar Hjalmarsson Edit question
Last query:
2014-03-23
Last reply:
2014-03-24

This question was originally filed as bug #1296209.

Gunnar Hjalmarsson (gunnarhj) said : #1

I think I understand.

As I suspected, ~/.environment is not sourced. If it was, LANG would be de_DE.UTF-8 when you run the locale command, right? The user specific equivalent to /etc/environment is ~/.pam_environment.

Saw at bug #1296230 that the Language Support icon is missing for you too. That has to be fixed, of course.

The options in the language chooser on the login screen reflect the installed translations (with "en" as the exception), so I don't really understand how this would be a bug, so I convert this bug report to a question.

Gunnar Hjalmarsson (gunnarhj) said : #2

Ok, Rolf, thought I'd give you a couple of more hints about how to fix it.

Even if you prefer to know which config files are involved and how, I still suggest that you start by removing the LC_MESSAGES line from /etc/environment and removing the ~/.environment file. Then, as soon as your System Settings menu is complete, start by using Language Support. Language Support stores (via accountsservice) the settings in two files:

  /etc/default/locale
  ~/.pam_environment

Then you can see how languages and locales are dealt with 'the Ubuntu way', and start from there if you want to tweak it further.

Useful link:
https://help.ubuntu.com/community/EnvironmentVariables
(See especially the sections "Persistent environment variables" and "Locale setting variables".)

HTH

Can you help with this problem?

Provide an answer of your own, or ask Rolf Leggewie for more information if necessary.

To post a message you must log in.