Table of Contents

Locale


Change Timezone

  #dpkg-reconfigure tzdata

Installed locales

We want to have Dutch locales installed. First check which locales are already installed. The expected output looks similar like below:

# locale -a
-------------
C
C.UTF-8
dutch
en_US.utf8
nl_NL
nl_NL@euro
nl_NL.iso88591
nl_NL.iso885915@euro
nl_NL.utf8
POSIX

If the Dutch locale are not yet present, we need to install them first. Do this by running the following command to generate a locale for the region you need:

dpkg-reconfigure locales 

You get a dialog with all available locales. Select the Dutch locales ([*] nl_NL ISO-8859-1 [*] nl_NL.UTF-8 UTF-8 [*] nl_NL@euro ISO-8859-15) and press OK. Select as default: en_US.UTF-8. Once you press OK you should see the following output:

Generating locales (this might take a while)...
  en_US.UTF-8... done
  nl_NL ISO-8859-1... done
  nl_NL.UTF-8 UTF-8... done
  nl_NL@euro ISO-8859-15... done
Generation complete.

This confirms that the locale you selected is generated and you can use it on your system. To verify that it is enabled you can run the locale -a command again. The output should contain the system locale you selected and generated with the previous command.

# locale -a
-------------
C
C.UTF-8
dutch
en_US.utf8
nl_NL
nl_NL@euro
nl_NL.iso88591
nl_NL.iso885915@euro
nl_NL.utf8
POSIX

Changing locale manually

The locale file /etc/default/locale can be edited manually. If this file does not exist, then no locale is currently set for your system. You can create one manually and enable a locale for your system. The output below shows how the file should look like:

# nano /etc/default/locale
--------------------------

#  File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE="en_US:en"
LC_TIME="nl_NL.UTF-8"
LC_NUMERIC="nl_NL.UTF-8"
LC_MONETARY="nl_NL.UTF-8"
LC_PAPER="nl_NL.UTF-8"

Replace with the locale you wish to have active on your system and save the file. Once you save the file, log out from your current session and then log back in, or open a new terminal, and your newly chosen locale will be active.

Changing locale for specific parts

Updating the LANG variable allows you to change the locale for the entire system at once. If you want to set up the locale for a specific part of the system you should edit the appropriate variable. Here are a few useful variables to know:

LC_MESSAGES – Sets the language for system messages.
LC_RESPONSE – Sets the language for dialogs shown on screen (e.g. “Yes” or “No” dialogs).
LC_NUMERIC – Sets the format for numbers depending on the region (e.g. decimals and commas being switched in some countries).
LC_TIME – Sets the format for the time and date.
LC_COLLATE – Sets the alphabetical order for strings (e.g. file names).
LC_MONETARY – Sets the currency name and symbol depending on the country.
LC_NAME – Sets the format for names (e.g. last name displayed before the first name).