Skip to content
TrySitePrice

How to Set Locales (i18n) On a Linux or Unix

Best/Tutorial

To set the locales (i18n) on a Linux or Unix system, you need to follow these steps:

  1. Generate the locale definition files for the desired locales by running the following command as root:
locale-gen locale_code

Replace "locale_code" with the desired locale code, for example "en_US.UTF-8".

  1. Set the system's default locale by editing the "/etc/locale.conf" file and adding the following line:
LANG=locale_code

Replace "locale_code" with the desired locale code, for example "en_US.UTF-8".

  1. Restart the system to apply the changes.
  2. Verify the locale settings by running the following command:
locale

This should display the system's locale information, including the default locale defined in "/etc/locale.conf".

Note: The exact steps to set the locales may vary depending on the Linux or Unix distribution being used. The above steps are general steps that should work on most distributions.