Closed: locale set in a peculiar way when using dietpi.txt Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
maelcum

Closed: locale set in a peculiar way when using dietpi.txt

Post by maelcum »

Hello,

since updating/changing to the DietPi v119 image, which in the meantime updates itself to v126 during the first few reboots, changing the locale - either set via the DiePi-GUI or via the dietpi.txt automation script - is not working correctly. Leaving the settings to en_GB works. I've gone with dietpi.txt as that makes the process and the results repeatable.

These parameters were used in dietpi.txt:

Code: Select all

#   Locale eg: en_GB en_US | Full list: cat /etc/locale.gen
AUTO_Locale=en_GB de_DE en_US
The result is:

Code: Select all

root@dietpi:~# locale 
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Note that LANG is still en_GB. Also notice the reported error about some LCs not being set, although they are listed like all others.

Btw time zone and keyboard layout (which are set along with locale) have also been changed and work nicely.

Could somebody help me out and explain what need to be configured to have the system run on en_US.UTF-8 for all LANG and LC-parameters?



Some more observations (which could help narrow down the problem):

Code: Select all

cat /etc/default/locale:
LANG=en_GB de_DE en_US.UTF-8
Note that there is more than one entry and only the last one has been suffixed with ".UTF-8".

Code: Select all

cat /etc/locale.gen | sed -n '/en_GB/p;/en_US/p;/de_DE/p'
# de_DE ISO-8859-1
# de_DE.UTF-8 UTF-8
# de_DE@euro ISO-8859-15
# en_GB ISO-8859-1
# en_GB.ISO-8859-15 ISO-8859-15
# en_GB.UTF-8 UTF-8
# en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
# en_US.UTF-8 UTF-8
/etc/locale.gen is available and has only lines with a "#" at the beginning. I would have thought at least some line (en_GB, en_US, de_DE) should be "unremarked".

Code: Select all

executing dpkg-reconfigure locales
starts the DietPi-GUI with "Configuring locales". Here nothing (not even en_GB.UTF-8) is marked as localed to be generated. Choosing the same three locales (en_GB.UTF-8, en_US.UTF-8, de_DE.UTF-8) and as a default locale en_US.UTF-8 solves the problem.

Code: Select all

root@dietpi:~# locale
LANG=en_GB
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
LANG is still set to en_GB though...

After that, /etc/locale.gen looks as it should (to me):

Code: Select all

cat /etc/locale.gen | sed -n '/en_GB/p;/en_US/p;/de_DE/p'
# de_DE ISO-8859-1
de_DE.UTF-8 UTF-8
# de_DE@euro ISO-8859-15
# en_GB ISO-8859-1
# en_GB.ISO-8859-15 ISO-8859-15
en_GB.UTF-8 UTF-8
# en_US ISO-8859-1
# en_US.ISO-8859-15 ISO-8859-15
en_US.UTF-8 UTF-8
Just as /etc/default/locale does:

Code: Select all

cat /etc/default/locale
LANG=en_US.UTF-8
Last edited by maelcum on Wed Aug 03, 2016 8:48 pm, edited 1 time in total.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: locale set in a peculiar way when using dietpi.txt

Post by k-plan »

Hi,
maelcum wrote:I've gone with dietpi.txt as that makes the process and the results repeatable.
maelcum wrote:Btw time zone and keyboard layout (which are set along with locale) have also been changed and work nicely.
Sorry, that you stumble on this old bug,

https://github.com/Fourdee/DietPi/issues/174

maelcum wrote:Could somebody help me out and explain what need to be configured to have the system run on en_US.UTF-8 for all LANG and LC-parameters?
Set language via 'dietpi-config' manually, choose 'en_GB.UTF-8' and 'en_US.UTF-8'. At the next dialogue choose 'en_US.UTF-8' as system defaut language.
Exit 'dietpi-config' and answer 'yes' to reboot the system.

cu
k-plan
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Closed: locale set in a peculiar way when using dietpi.t

Post by k-plan »

Addition:

Fourdee will have a look on it. :D
https://github.com/Fourdee/DietPi/issue ... -237338456

It' s not allowed to disable en_GB.UTF-8

Image



https://github.com/Fourdee/DietPi/issue ... -211495754

because in such cases, DietPi scripts can not parse correctly.

Example:
https://github.com/Fourdee/DietPi/blob/ ... ftware#L22

Default system locale can set to what ever you like, e.g. "de_DE.UTF-8 UTF-8"

cu
k-plan
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Post Reply