2

I installed ubuntu, using english as a language.

Then I added spanish, meant to be used by another user.

Now whenever I do something in apt the messages are in spanish

This is the content of my locale file:

$ cat /etc/default/locale 
#  File generated by update-locale
LANG=en_US.UTF-8
LC_NUMERIC="es_AR.UTF-8"
LC_TIME="es_AR.UTF-8"
LC_MONETARY="es_AR.UTF-8"
LC_PAPER="es_AR.UTF-8"
LC_NAME="es_AR.UTF-8"
LC_ADDRESS="es_AR.UTF-8"
LC_TELEPHONE="es_AR.UTF-8"
LC_MEASUREMENT="es_AR.UTF-8"
LC_IDENTIFICATION="es_AR.UTF-8"

I also tried running

sudo apt-get install language-pack-en language-pack-en-base manpages

and also

sudo dpkg-reconfigure locales

in which I chose en_US.UTF-8 UTF-8 and es_AR.UTF-8 UTF-8 (I don't want to mess the configuration of the spanish speaking user)

As default language for the entire system I choose: en_US.UTF-8 Also tried with:

$ sudo update-locale LANG=en_US.UTF-8

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

Abd then I tried adding export LANG=en_US.UTF-8 to my bashrc, but nothing seems to work.

Related questions:

opensas
  • 3,141
  • 6
  • 35
  • 42
  • 1
    When you say that "the messages are in Spanish", do you mean everything, or are you talking about the date/time formats? If the former, can you please edit your question and show us an output example? – Gunnar Hjalmarsson Apr 19 '20 at 22:46
  • 1
    What about `LANG=C sudo apt update`, `LANG=C sudo apt ugrade`, `LANG=C sudo apt full-upgrade`, etc? – DK Bose Apr 20 '20 at 01:47
  • 2
    @DKBose: Shouldn't be necessary when both `LC_MESSAGES` and `LANGUAGE` are correctly set to English. That's why I asked how much Spanish is actually shown. – Gunnar Hjalmarsson Apr 20 '20 at 04:34
  • 1
    @GunnarHjalmarsson okay, my system is English so I don't have real experience with troubleshooting such issues. – DK Bose Apr 20 '20 at 04:36
  • 2
    @DKBose: I suddenly spotted the problem. See my answer. – Gunnar Hjalmarsson Apr 20 '20 at 04:45

1 Answers1

2

I think I found the reason.

LANGUAGE=en_US:es

You must have set that manually; the UI would not allow you to. The thing is that the en_US translation files typically do not include translations, since the original strings are supposed to be American English. So gettext looks first for a translation in en_US, does not find any, and then go looking for a Spanish translation.

You should change it to:

LANGUAGE=en_US:en
Gunnar Hjalmarsson
  • 32,938
  • 3
  • 63
  • 94