Fixing locale problem in ArchLinux

For some reason I still don't understand, after doing the usual thing—configuring the es_ES language in the new KDE 5 installation—several applications stopped working. When I ran them in a terminal ( to see the error log ), I got the following:

terminate called after throwing an instance of 'std :: runtime_error' what (): locale :: facet :: _ S_create_c_locale name not valid

what does this mean?

That you have a language configured that the system has not 'caught' or accepted at all well.

How to solve it?

Simple, we must configure the system's locales or languages ​​well, which is what I will teach you how to do 

1. First we need to know which language we are going to use (obvious thing haha), let's suppose we will use: es_ES

2. Now let's open the venue listing file:

sudo nano /etc/locale.gen

3. We will then look for the following line in the file and uncomment it:

# en_ES.UTF-8 UTF-8

Uncomment means to remove the pound sign (#) from the beginning of that line.

That is, we will leave it like this:

en_ES.UTF-8 UTF-8

4. Okay, now let's generate the locations again:

sudo locale-gen

5. After doing this, let's check the /etc/locale.conf file:

sudo nano /etc/locale.conf

It should look like this:

LC_ALL = C LANG = es_ES.UTF-8 LC_COLLATE = es_ES.UTF-8

It happened to me that the first line (LC_ALL = C) was not added automatically, in case it is not applications will not work!

On some other sites you will see that they recommend the following command:

export LC_ALL = C

It is also completely valid 

The end!

Well nothing that. This gave me a good headache yesterday at home, because the line referring to LC_ALL = C was not being written in the .conf file, I don't know why ... well, applications like TeamSpeak or GParted didn't work. Maybe it has to do with what KDE 5 is ... but maybe not (I don't think it's KDE's fault).

Anyway, I hope it is useful to someone 


Add as preferred source in Google