FS#71978 - [glibc] Weird interactions in gettext between LANGUAGE and LC_MESSAGES

Attached to Project: Arch Linux
Opened by Konrad (cloud-oak) - Wednesday, 01 September 2021, 10:09 GMT
Last edited by freswa (frederik) - Monday, 14 February 2022, 16:49 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Giancarlo Razzolini (grazzolini)
freswa (frederik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When both LANGUAGE and LC_MESSAGES are both set, the output of gettext-based localizations is wrong (English locales listed in LANGUAGE are skipped).

Steps to reproduce:
env --ignore-environment LANGUAGE=en:es:fr tar # English Output
env --ignore-environment LC_MESSAGES=de_DE.UTF-8 tar # German Output
env --ignore-environment LANGUAGE=en:es:fr LC_MESSAGES=de_DE.UTF-8 tar # Spanish Output, but English output would be expected

gettext(3) states that if LC_MESSAGES is set to a valid locale other than "C", LANGUAGE will take precedence over LC_MESSAGES and is assumed to contain a colon-separated list of locale names that are then tried in order. For some reason on Arch, english locales are skipped in this colon-separated list, leading to the behaviour described above.

Versions:
glibc: 2.33-5

This issue appears to be specific to Arch, I cannot reproduce it in KDE Neon (glibc 2.31-0ubuntu9.2) or OpenSuSE Tumbleweed (glibc 2.33-9.1).
This task depends upon

Closed by  freswa (frederik)
Monday, 14 February 2022, 16:49 GMT
Reason for closing:  Fixed
Additional comments about closing:  glibc 2.35
Comment by Jan de Groot (JGC) - Wednesday, 01 September 2021, 13:12 GMT
Did you generate an English locale using /etc/locale.gen and locale-gen?

First guess would be that English is missing and Spanish exists. If that's the case here, your first example gives English output because it uses the default C locale (which is English in most applications and libraries).
Comment by Konrad (cloud-oak) - Wednesday, 01 September 2021, 18:17 GMT
Yes, the locales are generated. I tried debugging this with another user on @archlinux:matrix.org yesterday who could also reproduce this issue.
Comment by freswa (frederik) - Friday, 11 February 2022, 16:14 GMT
Is this still an issue with glibc 2.35?
Comment by Konrad (cloud-oak) - Monday, 14 February 2022, 16:39 GMT
The issue appears to be fixed with glibc 2.35, I cannot reproduce it in an archlinux docker image with glibc=2.35-2.

Loading...