Re: cannot set locale (systemd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Fri, Aug 31, 2012 at 11:30 AM, Thanos Zygouris
<athanasios.zygouris@xxxxxxxxx> wrote:
> After upgrading systemd (189-3) and filesystem (2012.8-1) my locale
> isn't en_US.UTF-8 anymore. Instead, it defaults to C.
>
> # cat /etc/locale.conf:
> LOCALE=en_US.UTF-8
> LC_COLLATE=C
>
> # locale
> LANG=C
> LC_CTYPE="C"
> LC_NUMERIC="C"
> LC_TIME="C"
> LC_COLLATE=C
> LC_MONETARY="C"
> LC_MESSAGES="C"
> LC_PAPER="C"
> LC_NAME="C"
> LC_ADDRESS="C"
> LC_TELEPHONE="C"
> LC_MEASUREMENT="C"
> LC_IDENTIFICATION="C"
> LC_ALL=

Do you have a $HOME/.config/locale.conf? What does it contain?

> I tried to run /etc/profile.d/locale.sh manually, but nothing changed.
> If i manually export LANG="en_US.UTF-8", it works, but i suspect it's
> not the "correct" way.

Could you put some debug output in the if/else block to figure out
what is happening? E.g.,


if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
  echo "using XDG_CONFIG_HOME"
  . "$XDG_CONFIG_HOME/locale.conf"
elif [ -n $HOME ] && [ -r $HOME/.config/locale.conf ]; then
  echo "using HOME"
  . "$HOME/.config/locale.conf"
elif [ -r /etc/locale.conf ]; then
  echo "using system-wide"
  . /etc/locale.conf
elif [ -r /etc/rc.conf ]; then
  echo "using rc.conf"
  LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE")
fi

And then run it manually to see what is happening.

Cheers,

Tom


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux