#945788 lightdm: Language support is broken

Package:
lightdm
Source:
lightdm
Description:
simple display manager
Submitter:
Santiago Castillo Oli
Date:
2022-05-03 19:45:02 UTC
Severity:
important
Tags:
#945788#5
Date:
2019-11-28 17:43:00 UTC
From:
To:
Dear Maintainer,

I would like to use the language selector of lightdm but I found that it
doesn't work.

I see there are several bug reports about this (864154, 784065, 765077,
690899, 691446), but they are only addressing small parts of the problem
and those bugs doesn't have a proper solution.

So i will try to offer a more general view of the problem.


- First of all, chosen language at lightdm greeter is overridden if LANG
is defined in /etc/default/locale. This is because /etc/pam.d/lightdm
contains:

session      required pam_env.so readenv=1 envfile=/etc/default/locale

No matter what Language you choose in lightdm selector. You'll have
system wide LANG setting.

So first step for language selector to work is to comment the above line.



- After commenting the above line, you can choose language with lightdm
greeter at login time, but it won't work with that session. It will work
the next session.

Let me explain it with an example:

Before login, according to /home/user/.dmrc,
/var/lib/AccountsService/users/user and /var/cache/lightdm/user.dmrc you
have Language=de_DE.utf8 (German)

In lightdm greeter login you choose "fr_FR.utf8" (French), enter login
name and password, and a plasma (in my case) session with German
language will start.

/home/user/.dmrc, /var/lib/AccountsService/users/user and
/var/cache/lightdm/user.dmrc files are updated to fr_FR.utf8 but that
first session have the previous language settings.

The next time you start a session from lightdm the language will be
French, no matter what you choose at language selector.

The language selector doesn't set the language for the very next login
but  the "next login after this login".

In other words, the language of the session will be the one we chose the
previous login, not what we have choose this login.



- There is a third problem with language selector. If accountsservice is
installed, files in /var/lib/AccountsService/users/ are read and
written, this is correct. But, If accountsservice is uninstalled, and
there are files in /var/lib/AccountsService/users/, those files are
still read, and this is wrong.

If, lets say, a user with accountservice installed choose one language
at lightdm greeter, that settings is save in a file in
/var/lib/AccountsService/users/. Then, if the user uninstall
accountsservice but don't delete the file at
/var/lib/AccountsService/users he will always use the Language defined
there, no matter what he choose at language selector. Lightdm will read
that file, that won't be updated to newer choices of language because
accountsservice is no longer running.



could this be fixed, please?

Thank you very much.

#945788#10
Date:
2022-05-03 19:40:58 UTC
From:
To:
I confirm that this bug still exists as described on Bullseye. The weird behavior of not using the selected language until the second login is an upstream issue present (for years and years) in all distros I've tried. But the /etc/pam.d/lightdm quirk is unique to Debian. Could at least that last sub-issue be fixed? Thanks a lot.