Bug 12808

Summary: Localedrake doesn't work for regular users
Product: Mageia Reporter: Kateto <ruben33en-mandriva>
Component: RPM PackagesAssignee: Base system maintainers <basesystem>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: Normal CC: mageia, mageia, mageiatools, marja11, nicolas.salguero, olav, thierry.vignaud
Version: CauldronKeywords: PATCH
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard: MGA6TOO
Source RPM: drakxtools, systemd CVE:
Status comment:
Attachments: A patched version of initscripts-mgaconf.patch

Description Kateto 2014-02-18 13:27:09 CET
Description of problem:

The environment variables set by localedrake in the file ~/.i18n don't seem to be picked up by the system at all.
Here's my ~/.i18n:

[ruben@localhost ~]$ cat .i18n
# Fitxer de sistema: /etc/sysconfig/i18n
# Localedrake reescriu aquest fitxer!
LC_TELEPHONE=ca_AD.UTF-8
LC_CTYPE=ca_AD.UTF-8
# LANGUAGE=ca:es_ES:es
LANGUAGE=ca:eo:en
LC_MONETARY=ca_AD.UTF-8
LC_ADDRESS=ca_AD.UTF-8
LC_COLLATE=ca_AD.UTF-8
LC_PAPER=ca_AD.UTF-8
C_NAME=ca_AD.UTF-8
LC_NUMERIC=ca_AD.UTF-8
LC_MEASUREMENT=ca_AD.UTF-8
LC_TIME=ca_AD.UTF-8
LANG=ca_AD.UTF-8
LC_IDENTIFICATION=ca_AD.UTF-8
LC_MESSAGES=ca_AD.UTF-8
GTK_IM_MODULE=ibus
QT_IM_MODULE=ibus
XMODIFIERS=@im=ibus
# Cal descomentar això perquè Ibus s'engegui a l'inici de sessió
XIM_PROGRAM="ibus-daemon -d -x"

However, the variables aren't read:
[ruben@localhost ~]$ echo $LANGUAGE
ca:es_ES:es
[ruben@localhost ~]$ echo $XMODIFIERS
@im=none

Version-Release number of selected component (if applicable):

How reproducible:
Always, either through localedrake or editing ~/.i18n by hand.

Steps to Reproduce:
1. Run localedrake as a regular user, either from the menu entry or from terminal.
2. Change your language to one of the installed ones, or set an input method like Ibus or Scim.
3. Log out and back in. Nothing has changed. 


Reproducible: 

Steps to Reproduce:
Comment 1 Thierry Vignaud 2014-02-18 22:37:14 CET
Your shell is expected to read it.
(through /etc/profile.d/10lang.sh)

What's your desktop?

CC: (none) => thierry.vignaud
Whiteboard: (none) => version

Comment 2 Kateto 2014-02-21 23:13:31 CET
I'm using LXDE. My display manager is LXDM too. Is that the problem?
Comment 3 Kateto 2014-02-22 19:37:10 CET
Actually, it seems other people has encountered that problem when using LXDM and Ibus:
http://translate.google.com/translate?sl=zh-CN&tl=en&js=n&prev=_t&hl=ca&ie=UTF-8&u=http%3A%2F%2Fwww.ubuntu-tw.org%2Fmodules%2Fnewbb%2Fviewtopic.php%3Ftopic_id%3D52594

Also, I use autologin.
Comment 4 Kateto 2014-03-09 08:59:15 CET
BUMP! Any news on this?
Comment 5 Marja Van Waes 2015-03-31 16:05:27 CEST
Mageia 3 changed to end-of-life (EOL) status 4 months ago.
http://blog.mageia.org/en/2014/11/26/lets-say-goodbye-to-mageia-3/ 

Mageia 3 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: NEW => RESOLVED
Resolution: (none) => OLD

Comment 6 Thierry Vignaud 2015-04-01 05:36:42 CEST
I think this one is still right.
@Olav, Nicolas: is there a way to configure gnome/kde/plasma locale per user now?

Status: RESOLVED => REOPENED
CC: (none) => mageia, mageia, olav
Version: 3 => Cauldron
Resolution: OLD => (none)

Comment 7 Olav Vitters 2015-04-01 10:06:26 CEST
This should be used:
http://www.freedesktop.org/wiki/Software/systemd/localed/
Comment 8 Thierry Vignaud 2015-04-01 10:08:45 CEST
This alters the _system_ setting, not the _user_ setting.
Previously we could have system in English, user A in French, user B in Spanish, ...
For now, that's no more possible...
Comment 9 Colin Guthrie 2015-04-01 10:11:02 CEST
(In reply to Thierry Vignaud from comment #8)
> This alters the _system_ setting, not the _user_ setting.
> Previously we could have system in English, user A in French, user B in
> Spanish, ...
> For now, that's no more possible...

FWIW, this was discussed recently at various hackfests.

There are plans to make localed work in the user session on the user bus too (and inface the systemd-consoled for text console logins makes some progress towards this).

So while fixing this in the short term is good, longer term, this will very much be possible.
Comment 10 Colin Guthrie 2015-04-01 10:19:05 CEST
inface = in fact
Comment 11 Samuel Verschelde 2015-06-06 00:54:36 CEST
Is this bug still present in latest cauldron? Adding NEEDINFO whiteboard marker.

Keywords: (none) => NEEDINFO

Comment 12 Samuel Verschelde 2015-06-06 00:54:53 CEST
(In reply to Samuel VERSCHELDE from comment #11)
> Is this bug still present in latest cauldron? Adding NEEDINFO whiteboard
> marker.

(keyword, actually)
Kateto 2015-10-24 09:03:31 CEST

Version: Cauldron => 5

Comment 13 Kateto 2015-10-24 09:14:26 CEST
I'm now on Mageia 5 (still with LXDE and LXDM) and after a year and half and two Mageia versions this is still not working. The user desktop doesn't pick up any change to ~/.i18n.
In fact, Mageia's management of multiple languages seems screwed up from the ground up. LXDM doesn't let me change languages either. What's the point of allowing the installation of multiple languages then? Just using up disk space?

I teach immigrant kids and I want to make things easier on them by installing their languages on our laptops. If I can't do it, Linux is no better than Windows.
Or maybe I should be trying a better distro? I hope not, after using this one since the Mandriva 2007 times.
Comment 14 Marja Van Waes 2016-02-17 20:28:14 CET
(In reply to Rubén Fernández from comment #13)
> I'm now on Mageia 5 (still with LXDE and LXDM) and after a year and half and
> two Mageia versions this is still not working. The user desktop doesn't pick
> up any change to ~/.i18n.

CC'ing the LXDE maintainer, in case there's something he can do


(In reply to Colin Guthrie from comment #9)
> (In reply to Thierry Vignaud from comment #8)

> > Previously we could have system in English, user A in French, user B in
> > Spanish, ...
> > For now, that's no more possible...
> 
> FWIW, this was discussed recently at various hackfests.
> 
> There are plans to make localed work in the user session on the user bus too
> (and in fact the systemd-consoled for text console logins makes some progress
> towards this).
> 


@ Colin

Is there any news?

Keywords: NEEDINFO => (none)
CC: (none) => marja11, nicolas.salguero
Assignee: bugsquad => mageia
Source RPM: drakxtools-15.54.1-3.mga3.src.rpm => drakxtools, systemd
Whiteboard: version => (none)

Comment 15 Nicolas Salguero 2016-02-18 16:24:41 CET
Created attachment 7471 [details]
A patched version of initscripts-mgaconf.patch

Hi,

I did some tests and found that, whether you use autologin or not, a login shell (i.e. which sources /etc/profile, then /etc/profile.d/10lang.sh) is launched when no user is already defined.  So, the code:
"""
for langfile in "$HOME/.i18n" /etc/locale.conf /etc/sysconfig/i18n ; do
        [ -f $langfile -a "$LC_SOURCED" != 1 ] && . $langfile && LC_SOURCED=1 && export LC_SOURCED
done
"""
skips "$HOME/.i18n" and sets LC_SOURCED to 1 for /etc/locale.conf.

When the user logs into LXDE, LC_SOURCED=1 and the above code is not executed anymore (and "$HOME/.i18n" is ignored even if it exists).

The solution is to do "unset LC_SOURCED" at the beginning of the script in all cases.

Best regards,

Nico.
Rémi Verschelde 2016-02-18 16:30:01 CET

Keywords: (none) => PATCH

Comment 16 Marja Van Waes 2018-04-24 18:38:02 CEST
(In reply to Nicolas Salguero from comment #15)
> Created attachment 7471 [details]
> A patched version of initscripts-mgaconf.patch
> 

Hi Nico,

Thanks for your patch and sorry if nothing was done with it.

Do you know whether this bug is still valid for Mga6 and Cauldron?

(Reassigning to the basesystem maintainers, in case this report needs to stay open for a supported Mageia version)

Assignee: mageia => basesystem

Comment 17 Marja Van Waes 2018-10-07 15:55:20 CEST
Maybe this did get fixed, but I want to be absolutely sure, so changing Version: to Cauldron and setting MGA6TOO until it is proven this got fixed.

Whiteboard: (none) => MGA6TOO
CC: (none) => mageiatools
Hardware: i586 => All
Version: 5 => Cauldron