Skip to content

locale: Load system locale from /etc/default/locale#282

Open
Taresu wants to merge 1 commit into
linuxmint:masterfrom
Taresu:fix/142
Open

locale: Load system locale from /etc/default/locale#282
Taresu wants to merge 1 commit into
linuxmint:masterfrom
Taresu:fix/142

Conversation

@Taresu
Copy link
Copy Markdown

@Taresu Taresu commented May 13, 2026

Problem

When the system locale is configured in /etc/default/locale (e.g. LANG=pt_BR.UTF-8), PAM messages shown by slick-greeter during login (password expiry warnings, password quality checks) appear in English instead of the configured language.

The root cause is that LightDM does not load /etc/default/locale when spawning the greeter process. This is by design: in LightDM's seat.c, create_greeter_session() does not apply language configuration -> that
only happens for user sessions. As a result, the greeter inherits a minimal environment with no locale variables set.

The greeter already calls Intl.setlocale(LocaleCategory.ALL, "") at startup, but with no LANG or LC_* variables in the environment it always falls back to the C locale, and all PAM message translations are ignored.

References

Affected versions

1.0.0 through 2.2.6 (current) - all Linux Mint releases from 18.3 (Sonya) to 22.3 (Zena).

Steps to reproduce

  1. Configure a non-English locale in /etc/default/locale (e.g. LANG=pt_BR.UTF-8).
  2. Force a user's password to expire: sudo chage -d 0 <user>.
  3. Log in as that user at the greeter -> the password change prompts appear in English instead of the configured locale.

Expected behaviour

PAM messages shown by the greeter should honour the system locale configured in /etc/default/locale.

Fix

Added load_locale() in src/slick-greeter.vala, called immediately before Intl.setlocale(). It reads /etc/default/locale, parses KEY=value lines (strips quotes, skips comments), and sets any missing locale environment variables. This is modeled on the existing /etc/default/keyboard reading pattern already used in menubar.vala (added in commit 1aa6d58).

Closes #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Messages not honoring system locale

1 participant