Language and regional settings

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
voyst
Posts: 4
Joined: 2021-03-14 14:03

Language and regional settings

#1 Post by voyst »

My problem is probably very simple, but I haven't been able to solve it so far.

My locale is en_US.UTF-8.
I would like to continue using the US keyboard, and US English as system language, but I would like to have the "European" settings (EURO currency, degrees Celsius, A4 paper size, week start on Monday, etc.). How should I achieve this?

Thank you!

peter_irich
Posts: 1328
Joined: 2009-09-10 20:15
Location: Saint-Petersburg, Russian Federation

Re: Language and regional settings

#2 Post by peter_irich »

I think firrst you can try tweak file /etc/default/locale.

Peter.

mm3100
Posts: 137
Joined: 2020-10-21 21:39
Has thanked: 3 times

Re: Language and regional settings

#3 Post by mm3100 »

First try to set it up in your DE settings. After that change locale file. As I had some issues with DE not recognizing changes I made to locale file.

If you are going to make changes to locale file you first need to have your language localisations generated. You can see your current locale configuration by running

Code: Select all

locale
First save current locale configuration.

Code: Select all

sudo cp /etc/default/locale /etc/default/locale.old
Then to add additional language of choice and to make sure you can use it

Code: Select all

sudo dpkg-reconfigure locales 
And select locales you with to have, for my case I wanted hr_HR.UTF-8 and en_US.UTF-8 (default english one). You can scroll up and down and select them. After that continue and set none as default one.

After that you can set what parts you want to have with specific languages formats.
LANG Provides default value for LC_* variables that have not been explicitly set.
LC_ADDRESS How addresses are formatted (country first or last, where zip code goes etc.).
LC_ALL Overrides individual LC_* settings: if LC_ALL is set, none of the below have any effect.
LC_COLLATE How strings (file names...) are alphabetically sorted. Using the "C" or "POSIX" locale here results in a strcmp()-like sort order, which may be preferable to language-specific locales.
LC_CTYPE How characters are classified as letters, numbers etc. This determines things like how characters are converted between upper and lower case.
LC_IDENTIFICATION Metadata about the locale information.
LC_MEASUREMENT What units of measurement are used (feet, meters, pounds, kilos etc.).
LC_MESSAGES What language should be used for system messages.
LC_MONETARY What currency you use, its name, and its symbol.
LC_NAME How names are represented (surname first or last, etc.).
LC_NUMERIC How you format your numbers. For example, in many countries a period (.) is used as a decimal separator, while others use a comma (,).
LC_PAPER Paper sizes: 11 x 17 inches, A4, etc.
LC_RESPONSE Determines how responses (such as Yes and No) appear in the local language
LC_TELEPHONE What your telephone numbers look like.
LC_TIME How your time and date are formatted. Use for example "en_DK.UTF-8" to get a 24-hour-clock in some programs.
To use it run

Code: Select all

sudo update-locale LC_TIME="hr_HR.UTF-8"
This will set time format as is standard for croatian. You can do similar for all or just few of those that you wanted to. For paper in croatia it is standard iso A4, and I would run

Code: Select all

sudo update-locale LC_PAPER ="hr_HR.UTF-8"
You would need to do same for language of your choice.

Once you are done with it, you don't have to do them all, as if you would look at old one /etc/default/locale.old.

Finally run

Code: Select all

sudo locale-gen
Then log out, and pray it works. If something is wrong, or not working you can go back to previous configuration

Code: Select all

sudo cp /etc/default/locale.old /etc/default/locale
sudo locale-gen
Just make sure LC_ALL= is absent from /etc/default/locale or has nothing applied to it, since that will override all other changes.

Post Reply