gnome-language-selector -> Regional Formats: Please indicate if it is overriden by LC_ALL

Bug #2035044 reported by David Hedlund
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
language-selector (Ubuntu)
Opinion
Wishlist
Unassigned

Bug Description

* Open gnome-language-selector, and click on the Regional Formats tab.
* Change the value in the `Display numbers, dates and currency amounts in the usual format for:` drop-down list, say `English (Canada)`
* Close the gnome-language-selector window.
* Run this in a terminal: `your_locale="en_US"; sudo update-locale LANG="$your_locale".UTF-8 LANGUAGE="$your_locale" LC_ALL="$your_locale".UTF-8`
* Log out and in from the desktop environment
* Again, open gnome-language-selector, and click on the Regional Formats tab. As you can see, it appears like `English (Canada)` even if it is overridden by LC_ALL ("English (United States)")

ProblemType: Bug
DistroRelease: Ubuntu 23.04
Package: language-selector-gnome 0.221
ProcVersionSignature: Ubuntu 6.2.0-20.20-generic 6.2.6
Uname: Linux 6.2.0-20-generic x86_64
ApportVersion: 2.26.1-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: unknown
CurrentDesktop: ubuntu:GNOME
Date: Mon Sep 11 01:42:32 2023
InstallationDate: Installed on 2023-04-23 (140 days ago)
InstallationMedia: Ubuntu 23.04 "Lunar Lobster" - Release amd64 (20230418)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: language-selector
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
David Hedlund (g-public) wrote :
David Hedlund (g-public)
summary: - gnome-language-selector -> Regional Formats: Please indicate if it is
- overriden by LC_ALL
+ Regional Formats: Please indicate if it is overriden by LC_ALL
summary: - Regional Formats: Please indicate if it is overriden by LC_ALL
+ gnome-language-selector -> Regional Formats: Please indicate if it is
+ overriden by LC_ALL
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

Setting LC_ALL that way persistently on a desktop is a misconfiguration. There is no way to do that through Language Selector or any other GUI. I doubt it would be reasonable to expect from a GUI that it warns for that kind of misconfiguration.

Changed in language-selector (Ubuntu):
importance: Undecided → Wishlist
status: New → Opinion
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

If you want the settings be applied system wide, there is the button "Apply System-Wide" in Language Support for the purpose. Pressing that button will make changes to /etc/default/locale and should be effective at next login (or possibly a reboot is needed). But LC_ALL must of course not be set anywhere.

Revision history for this message
David Hedlund (g-public) wrote (last edit ):

> If you want the settings be applied system wide, there is the button "Apply System-Wide" in Language Support for the purpose. Pressing that button will make changes to /etc/default/locale and should be effective at next login (or possibly a reboot is needed). But LC_ALL must of course not be set anywhere.

I tried that a few weeks ago. After I logged out and in:

$ cat /etc/default/locale
# File generated by update-locale
LANG="en_US.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_CA.UTF-8
LC_TIME=en_CA.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_CA.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_CA.UTF-8
LC_NAME=en_CA.UTF-8
LC_ADDRESS=en_CA.UTF-8
LC_TELEPHONE=en_CA.UTF-8
LC_MEASUREMENT=en_CA.UTF-8
LC_IDENTIFICATION=en_CA.UTF-8
LC_ALL=

$ locale | grep en_US | grep LC_
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"

The latter variables are not set to "en_CA.UTF-8"

"Setting LC_ALL that way persistently on a desktop is a misconfiguration"?

Is it? This will set LC_CTYPE, LC_COLLATE, LC_MESSAGES, etc:

* $ your_locale="en_CA"; sudo update-locale LANG="$your_locale".UTF-8 LANGUAGE="$your_locale" LC_ALL="$your_locale".UTF-8
* $ source /etc/default/locale
* $ locale
LANG=en_CA.UTF-8
LANGUAGE=en_CA
LC_CTYPE="en_CA.UTF-8"
LC_NUMERIC="en_CA.UTF-8"
LC_TIME="en_CA.UTF-8"
LC_COLLATE="en_CA.UTF-8"
LC_MONETARY="en_CA.UTF-8"
LC_MESSAGES="en_CA.UTF-8"
LC_PAPER="en_CA.UTF-8"
LC_NAME="en_CA.UTF-8"
LC_ADDRESS="en_CA.UTF-8"
LC_TELEPHONE="en_CA.UTF-8"
LC_MEASUREMENT="en_CA.UTF-8"
LC_IDENTIFICATION="en_CA.UTF-8"
LC_ALL=en_CA.UTF-8

David Hedlund (g-public)
description: updated
David Hedlund (g-public)
description: updated
Revision history for this message
Gunnar Hjalmarsson (gunnarhj) wrote :

> $ cat /etc/default/locale
> # File generated by update-locale
> LANG="en_US.UTF-8"
> LC_NUMERIC="en_CA.UTF-8"
> LC_TIME="en_CA.UTF-8"
> LC_MONETARY="en_CA.UTF-8"
> LC_PAPER="en_CA.UTF-8"
> LC_IDENTIFICATION="en_CA.UTF-8"
> LC_NAME="en_CA.UTF-8"
> LC_ADDRESS="en_CA.UTF-8"
> LC_TELEPHONE="en_CA.UTF-8"
> LC_MEASUREMENT="en_CA.UTF-8"
>
> $ locale
> LANG=en_US.UTF-8
> LANGUAGE=en_US
> LC_CTYPE="en_US.UTF-8"
> LC_NUMERIC=en_CA.UTF-8
> LC_TIME=en_CA.UTF-8
> LC_COLLATE="en_US.UTF-8"
> LC_MONETARY=en_CA.UTF-8
> LC_MESSAGES="en_US.UTF-8"
> LC_PAPER=en_CA.UTF-8
> LC_NAME=en_CA.UTF-8
> LC_ADDRESS=en_CA.UTF-8
> LC_TELEPHONE=en_CA.UTF-8
> LC_MEASUREMENT=en_CA.UTF-8
> LC_IDENTIFICATION=en_CA.UTF-8
> LC_ALL=
>
> $ locale | grep en_US | grep LC_
> LC_CTYPE="en_US.UTF-8"
> LC_COLLATE="en_US.UTF-8"
> LC_MESSAGES="en_US.UTF-8"
>
> The latter variables are not set to "en_CA.UTF-8"

That's true, and it's intended behavior. The idea is to distinguish between language and regional formats, and the latter variables are considered to be part of the language option.

> "Setting LC_ALL that way persistently on a desktop is a misconfiguration"?
>
> Is it?

Yes it is. If you want the same locale for every locale category, just make sure that you select the same locale for both language and regional formats.

LC_ALL is typically used by coders. It's not suitable as an environment variable on a desktop, since it makes any UI for this purpose useless.

If you want to make an exception for a particular locale category, e.g. LC_CTYPE or LC_TIME, then set that category separately. But leave LC_ALL unset.

> How does gnome-language-selector reload ~/.pam_environment ?

It doesn't. PAM loads ~/.pam_environment at login.

Revision history for this message
David Hedlund (g-public) wrote (last edit ):

It doesn't. PAM loads ~/.pam_environment at login.

I moved this discussion to a new feature request that I made at https://bugs.launchpad.net/ubuntu/+source/language-selector/+bug/2035212

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.