Home‎ > ‎Gnu/Linux‎ > ‎

How to Setup locale in Linux

posted Apr 13, 2013, 1:20 AM by ಸುಧೀಂದ್ರ ಕೃಷ್ಣಮೂರ್ತಿ

Today I have installed Gnome-shell and logged in. When I tried to launch digikam application it shown below warning to me -

Your locale has changed since this album was last opened. Old locale: UTF-8, new locale: ISO-8859-1 If you have recently changed your locale, you need not be concerned. Please note that if you switched to a locale that does not support some of the filenames in your collection, these files may no longer be found in the collection. If you are sure that you want to continue, click 'Yes'. Otherwise, click 'No' and correct your locale setting before restarting digiKam.

because till this point I used KDE only.

Then I opened terminal and issued a command "locale", 
I got below output, 
LANG=en_US.utf8
LANGUAGE=
LC_CTYPE="en_US.utf8"
LC_NUMERIC=en_IN.utf8
LC_TIME=en_IN.utf8
LC_COLLATE="en_US.utf8"
LC_MONETARY=en_IN.utf8
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT=en_IN.utf8
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

Where LANGUAGE = none.

After searching in Google I found out one very nice link How to set up a clean UTF-8 environment in Linux.
It worked. A Great thanks to that blog.

If already package locale installed, To setup or configure locale need to enter below command
dpkg-reconfigure locales
it will ask for the long list of locales in which we can select required one by navigating through up/down arrow keys. In next step again it will ask for the default locale to be set, we can safely select required locale.

There is another method you can set the locale,

open terminal, 

sudo gedit /etc/locale.gen
or sudo kate /etc/locale.gen

uncomment for the required locale, save and exit
for rebuild the locale, in terminal type the following,

locale-gen

By default locale.conf in /etc is not present, so we can create by running the following command,

locale > /etc/locale.conf

Now, logout and login again, your required locale settings in on.

Comments