Our friends over there in the US like to have their own measurement systems, and they don’t stop there. They also like to start the week on Sundays. I hear this has religious reasons.
This leads to problems when you generally want to set up your Debian systems with plain old English (US) locales but need proper measurement units in your programs. One of the solutions here is the magical file /etc/default/locale. Here’s a screenshot of what amazing feats this can accomplish:
My weeks start on Monday (as they should!) and I get European paper formats, Swiss date and time formats, but still have my precious English error messages. No one wants German nerdspeak, it’s gibberish! “Sendewarteschlangenlänge”? What does that even mean?
The beauty of the locale system is that you can mix and match any of these. You can have Portuguese weekdays with English error messages, Swedish currency and US paper formats.
First you have to generate all the locales you’d like to use (as root):
Then just put whatever combination you like in /etc/default/locales and log out and back in again. Here’s an example:
LANG=en_US.UTF-8 LC_NUMERIC=de_CH.UTF-8 LC_TIME=de_CH.UTF-8 LC_COLLATE=de_CH.UTF-8 LC_MONETARY=de_CH.UTF-8 LC_PAPER=de_CH.UTF-8 LC_MEASUREMENT=de_CH.UTF-8 LC_ADDRESS=de_CH.UTF-8 LANGUAGE="en_US:en"
The system gets US English spelling and language, but the rest is in German (Switzerland). So we Swiss Franc as currency, ‘ as a thousands separator, etc. And this works both in pure console sessions and in most desktop environments.
Be careful, though. Some desktop environments (like Plasma) allow you to override these settings in your desktop session.