How do I reconfigure locales properly on my desktop after installation?

I have dived several times into the labyrinthine locales configuration system, reading man pages and browsing the Internet. Every blog/tutorial/Q&A I read is either incomplete, adventurous, hyper complex, risky, contradictory, erroneous, incomprehensible, out of the case explanation, or all of them at the same time, and never explain how to undo the changes they suggest.

When installing a normal Ubuntu desktop, I want these reasonable settings:

  1. A certain keyboard model, in a certain language with certain options.
  2. A certain (different) language for default user folders, for the system and programs.
  3. A certain (different) language for numeric (thousands and decimals notation) format.
  4. A certain (different) language for dates format (the same as the keyboard language, in my case)
  5. And, last but not least, I'd like the desktop calendar to consider weeks starting at monday rather than sunday.

To configure these few things is something super simple in Windows, but in Ubuntu it seems to be a freaking nightmare.

For EXAMPLE, I may want:

  1. A certain Apple keyboard for Spain with its special symbols.
  2. All the system: names, messages, help info, applications, buttons..., in English.
  3. Dots to separate decimals and commas to separate thousands (not the Spanish way)
  4. Date formats in a certain Spanish format.
  5. Weeks starting at Monday in the desktop calendar.

Can anybody help?

I am still waiting for an answer to this common problem.

Is there no clear simple way to do it?


Solution 1:

You can manually edit the localisation settings. From your example I would suggest that you use some English version as the base language and add other bits according to your needs. Other bits you can get from other locale settings that must be also installed in your system. That is, if you want the system to be in Italian, dates in Russian style and numbers in Finnish the these packages to support those languages must be installed in your system.

You can see the full list of locales installed in your system by running this command in the terminal:

$ locale -a.

Or you can open System settings->Language support->Install/Remove languages. All the installed languages will be checked. To add or remove languages just check some more or uncheck unwanted ones. From your example I advise you use just English(includes many versions)+Spanish. The specifics of your current localisation settings can be checked with this command:

$ locale

Here is what these settings refer to:

LANG - Provides default value for LC_* variables that have not been explicitly set.

LC_ALL - Overrides individual LC_* settings: if LC_ALL is set, none of the below have any effect.

LC_CTYPE - How characters are classified as letters, numbers etc. This determines things like how characters are converted between upper and lower case.

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_TIME - How your time and date are formatted. Use for example "en_DK.UTF-8" to get a 24-hour-clock in some programs.

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_MONETARY - What currency you use, its name, and its symbol.

LC_MESSAGES - What language should be used for system messages.

LC_PAPER - Paper sizes: 11 x 17 inches, A4, etc.

LC_NAME - How names are represented (surname first or last, etc.).

LC_ADDRESS - How addresses are formatted (country first or last, where zip code goes etc.).

LC_TELEPHONE - What your telephone numbers look like.

LC_MEASUREMENT - What units of measurement are used (feet, meters, pounds, kilos etc.).

LC_IDENTIFICATION - Metadata about the locale information.

Here is your fix (hopefully):

  1. For folders and the system use chosen English language as the main language and that's it.

  2. For numeric values (with dots to separate decimals and commas to separate thousands) you could either just use the British English as the base for your system. But if you chose to use US English instead modify the “.profile” file in your home directory by adding this line to it:

    export LC_NUMERIC=”en_GB.utf8”

  3. For the dates and calendar you just need to change the time format localisation to Spanish (as far as I know then also the weeks will start with Mondays). So add also this line to the same .profile file in your home directory:

    export LC_TIME="es_ES.utf8"

Localisation will be applied on the next time you login to Ubuntu. You can check then the results by running “locale” command once more or just see if everything functions as you would like to.

Keyboard settings are separate from localisation settings and for your specific problem with the Apple keyboard use “console-data” package. For this run:

sudo dpkg-reconfigure console-data

But as probably the package is not yet installed in your system run this:

sudo apt-get install console-data

The install includes configuring your keyboard settings, so probably that is all you need. The mac Spanish keyboard was listed there – hopefully that is what you need.

Hopefully these tips will solve your problems.