8

Is it possible to change the language of a particular application so that when opened it shows in Spanish for example while the rest are in English?

I have Spanish and English installed in Ubuntu and am using English as the default one but I would like a way to change the language for a particular application without having to change the whole language of the system.

2

In one line:

LANGUAGE=es_ES gedit

(please notice I am using Linux Manjaro, in this case the variable is called LANGUAGE)

  • I just tested this and it worked beautifully for a bunch of apps. Kudos Luca. – Luis Alvarado Nov 5 '19 at 0:39
5

You can change the LANG environment variable in a terminal. After that, all the applications that you launch with the new environment will follow that new locale. For example:

gedit # Will use default locale (English in your case)
export LANG=es_ES
gedit # Will use Spanish (provided it's installed)

If you don't get the Spanish translations for the application, then:

  • Use locale -a | grep es command to verify that Spanish is already available.
  • Try to set LANG to the full string returned by locale -a, that is, es_ES.utf8 instead of just es.
  • Use the locale command to verify the values of your locale environment variables. Depending on your configuration it might happen that LANG is being shadowed by LC_ALL or LANGUAGE environment variables. To fix that, you could set LC_ALL or LANGUAGE directly.

More information about locale environment variables can be found in the Ubuntu documentation and in the gettext manual.

  • Please note that for gettext compatible applications you need to set LANGUAGE instead of LANG. See example in my answer. – Gunnar Hjalmarsson May 16 '15 at 3:24
2

I have normally Swedish as the session language, but want the terminal in English. I achieve it with this file:

$ cat ~/bin/gnome-terminal
#!/bin/sh
export LANGUAGE=en_US
exec /usr/bin/gnome-terminal $@

The file is chmod'ed with +x. With this method gnome-terminal is displayed in English irrespective of how start it - via graphical icon or via command line.

2

In my case, neither LC_ALL or LANG environmental commands worked (in Lubuntu) by setting the specific language encoding such as

LC_ALL=el_GR.UTF-8 vlc
export LANG=el_GR.UTF-8 

but I was able to set the language for the applications that I would like to run by using export and the generic name of the language. I had not installed it using locale-gen greek or anything similar with intention - I installed only el_gr* and similar versions.

Nontheless, the following worked for me - I run that command and then the desired application. Its language interface changed from the default one to the specified one:

export LANG=greek

and then you may return to default language of Linux system by writing:

 export LANG=c
1

If we're talking about a terminal application, you could set up an alias. I use GB English as my default language but our git repo server only runs on US English. So i added this alias:

alias git="env LC_ALL=\"en_US.UTF-8\" git"

You could add it to your .bashrc or your .aliases list if you use that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.