How to change language of a specific application?

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.


Solution 1:

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.

Solution 2:

In one line:

LANGUAGE=es_ES gedit

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