How to change language of a specific application?

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.


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.


In one line:

LANGUAGE=es_ES gedit

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

Tags:

Language

11.10