14

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.

Zanna
  • 70,465
Luis Alvarado
  • 211,503

6 Answers6

7

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.

jcollado
  • 9,598
5

In one line:

LANGUAGE=es_ES gedit

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

4

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.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94
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
Zanna
  • 70,465
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.

llaurén
  • 111
0

In my case,

sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales

LANGUAGE=en_US:en gedit