Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: Svein Wisnaes on June 25, 2010, 02:30:52 am

Title: Locale settings for non-english locale
Post by: Svein Wisnaes on June 25, 2010, 02:30:52 am
If you install Ubuntu Server 10.04 with English as language, but with a time zone for a country that do not have English as main language, you might end up with some warnings about locale when you access the server via command line.

I got a lot of the following message on my server:

Code: [Select]
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LC_PAPER = "pt_BR.UTF-8",
        LC_ADDRESS = "pt_BR.UTF-8",
        LC_MONETARY = "pt_BR.UTF-8",
        LC_NUMERIC = "pt_BR.UTF-8",
        LC_TELEPHONE = "pt_BR.UTF-8",
        LC_MESSAGES = "en_US.UTF-8",
        LC_COLLATE = "C",
        LC_IDENTIFICATION = "pt_BR.UTF-8",
        LC_MEASUREMENT = "pt_BR.UTF-8",
        LC_TIME = "en_GB.UTF-8",
        LC_NAME = "en_US.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

To check what locale you have available, issue the locale -a command. Here is what I had:

Code: [Select]
locale -a
C
POSIX
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8

To fix this, you need to either install or create the missing locale. I used this command:

Code: [Select]
sudo localedef -i pt_BR -f UTF-8 pt_BR.UTF-8
After doing a new locale -a I am now getting this:

Code: [Select]
locale -a
C
POSIX
en_AG
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_NG
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZW.utf8
pt_BR.utf8

The errors I was getting are gone :)



Title: Re: Locale settings for non-english locale
Post by: Marcus on December 19, 2012, 03:03:30 pm
Hello,

You may also simply run this command:
Code: [Select]
sudo apt-get install language-pack-<language>
** Replacing <language> with your own language.  For exemple, french would be "fr".
More precisely, it would look like this:
Code: [Select]
sudo apt-get install language-pack-fr
Best,

Marcus