77

I want to switch to French locale. So I tried the below command:

myUbundu@myUbundu-desktop:~$ export LC_ALL=fr_FR

But I am getting the warning

-bash: warning: setlocale: LC_ALL: cannot change locale (fr_FR)

How to set the locale to French? Do I need to install additional packages?

enzotib
  • 96,093

6 Answers6

62

Try the following commands

sudo locale-gen fr_FR
sudo update-locale LANG=fr_FR
enzotib
  • 96,093
LnxSlck
  • 12,456
44

I've had the same issue, and none of the answers worked, except dpkg-reconfigure locales. But it is too time consuming to do it this way. Just uncomment all the locales you need in /etc/locale.gen and run locale-gen. Or do it from the command line (as root):

echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
BuZZ-dEE
  • 14,533
Alek_A
  • 690
  • 6
  • 8
15

I have fought with this for a week or so.

The most reliable (and easiest too) for me was to edit my profile file with

gedit ~/.profile

An add this language variables to be set at every login

LANG="en_AU.UTF-8"
LANGUAGE="en_AU:en"

You need to log out and back in for the change to take effect.

Aas
  • 271
5

UTF-8

Here is the UTF-8 version of the most voted answer.

I received the following error:

-bash: warning: setlocale: LC_ALL: cannot change locale (en_IE.UTF-8)

Issuing the following command sufficed to get rid of this bash warning:

$ sudo locale-gen en_IE.UTF-8

P.S.: The Irish locale en_IE.UTF-8 provides English language with euro € as a currency.

Serge Stroobandt
  • 5,719
  • 1
  • 54
  • 59
4

Try installing language pack for French, e.g.

sudo apt-get install language-pack-fr

For any other language, run: check-language-support -l CODE to check the supported packages, e.g.

$ check-language-support -l fr
firefox-locale-fr gimp-help-fr hunspell-fr language-pack-fr language-pack-gnome-fr thunderbird-locale-fr wfrench

Check also: LC_ALL: cannot change locale.

kenorb
  • 10,944
1

This system had this problem and none of the other solutions worked. After grepping around, .xsessionrc had defined corrupted values. Maybe some program created it and it shouldn't be there? Anyway, corrected to reflect system settings:

export LC_ALL=fr_FR.UTF-8
export LANG=fr_FR.UTF-8
export LANGUAGE=fr_FR.UTF-8
hellork
  • 231