You are not logged in.

#1 2018-02-23 16:09:00

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

[SOLVED] Cannot change locale with locale-gen

When i installed Arch Linux i put the language on french (fr_FR.UTF-8 UTF-8)
but i wanted to change language to american english, so i changed /etc/locale.gen and uncommented en_US.UTF-8 UTF-8 (and recommented fr_FR.UTF-8 UTF-8)
but (sudo)locale-gen shows me :

$ sudo locale-gen
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (fr_FR.UTF-8)
Generating locales...
  en_US.UTF-8... done
Generation complete.

and when i reboot, the language is in french.

locale :

$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8

locale -a :

$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

When i

export LC_ALL="en_US.UTF-8"

locale shows me :

$ locale
LANG=fr_FR.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

but when i try to

source ~/.bashrc

it gives me :

$ source ~/.bashrc
bash: avertissement :setlocale : LC_ALL : impossible de changer le paramètre de langue (fr_FR.UTF-8)

which in english means : 

$ source ~/.bashrc
bash: warning :setlocale: LC_ALL : cannot change locale (fr_FR.UTF-8)

Please Help

Last edited by I4MTRUE (2018-02-23 16:39:08)

Offline

#2 2018-02-23 16:11:14

Scimmia
Fellow
Registered: 2012-09-01
Posts: 12,609

Re: [SOLVED] Cannot change locale with locale-gen

locale.gen and locale-gen just generates them. You need to change /etc/locale and anywhere else you have the LANG variable set.

Last edited by Scimmia (2018-02-23 16:11:29)

Offline

#3 2018-02-23 16:12:09

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

what do i put in /etc/locale and the others ?

Offline

#4 2018-02-23 16:13:48

seth
Member
Registered: 2012-09-03
Posts: 63,028

Offline

#5 2018-02-23 16:18:18

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

i did setup locale.gen and locale.conf and rebooted but it still don't work sad

Last edited by I4MTRUE (2018-02-23 16:18:34)

Offline

#6 2018-02-23 16:21:02

seth
Member
Registered: 2012-09-03
Posts: 63,028

Re: [SOLVED] Cannot change locale with locale-gen

cat /etc/locale.conf
localectl
locale
locale -a

Edit: w/o local environment changes, of course. Also do not try to edit the locale in your bashrc - this has no impact on eg. your desktop shell.

Last edited by seth (2018-02-23 16:22:22)

Offline

#7 2018-02-23 16:24:17

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

cat /etc/locale.conf gives me :

$ cat /etc/locale.conf
LANG="en_US.UTF-8"
LANGUAGE="en_US"
LC_COLLATE="C"
LC_ALL="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"

localectl gives me :

$ localectl
   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US
                  LC_COLLATE=C
       VC Keymap: fr
      X11 Layout: n/a

locale gives me :

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8

and locale -a

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_US.utf8

Last edited by I4MTRUE (2018-02-23 16:26:07)

Offline

#8 2018-02-23 16:28:08

seth
Member
Registered: 2012-09-03
Posts: 63,028

Re: [SOLVED] Cannot change locale with locale-gen

So something™ which is not your /etc/locale.conf sets your LC_* vars to fr_FR.UTF-8.
Did you log out/in after making those changes?
If yes, this is either in your ~/.profile, your ~/.bashrc or ~/.bash_profile or something your desktop session (which?) does. (Check it's settings GUI)

Offline

#9 2018-02-23 16:30:26

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

i think i got it, in bashrc there is :

...
#Locales
export LANGUAGE=fr_FR.UTF-8
export LANG=fr_FR.UTF-8
export LC_ALL=fr_FR.UTF-8
...

should i remove them ? or remplace them by en_US.UTF-8

Last edited by I4MTRUE (2018-02-23 16:31:03)

Offline

#10 2018-02-23 16:31:30

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 24,319

Re: [SOLVED] Cannot change locale with locale-gen

From what I'm getting they want everything to be fr_FR.UTF-8

However there's every evidence that the entry hasn't been uncommented properly in /etc/locale-gen recheck that file.

Whoops, totally misread, disregard.

But yes, remove them.

Last edited by V1del (2018-02-23 16:32:51)

Offline

#11 2018-02-23 16:32:35

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

ah ok

Last edited by I4MTRUE (2018-02-23 16:32:51)

Offline

#12 2018-02-23 16:32:45

seth
Member
Registered: 2012-09-03
Posts: 63,028

Re: [SOLVED] Cannot change locale with locale-gen

"Remove" - bashrc is no good place to control your profile (unless you want to alter it for interactive bash and interactive bash only - what's rather unlikely; you want to alter it for your entire session or a specific shell context)

Offline

#13 2018-02-23 16:38:37

I4MTRUE
Member
Registered: 2018-02-13
Posts: 24

Re: [SOLVED] Cannot change locale with locale-gen

so i changed bashrc and restarted my computer and locale is set to english
Thanks for the help big_smile

Offline

Board footer

Powered by FluxBB