How to change language of a specific application?

10,301

Solution 1

In one line:

LANGUAGE=es_ES gedit

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

Solution 2

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 3

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.

Solution 4

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

Solution 5

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.

Share:
10,301

Related videos on Youtube

Luis Alvarado
Author by

Luis Alvarado

System Engineer Social Engineer Master in Pedagogy Master in Open Source CCNA Certified Linux Foundation Certified Former Askubuntu Moderator Stack Careers | Linkedin | Launchpad | Ubuntu Wiki - Random SE Stuff - Latin American Members | JC Race Award | Human Robot Award 74

Updated on September 18, 2022

Comments

  • Luis Alvarado
    Luis Alvarado almost 2 years

    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.

  • Gunnar Hjalmarsson
    Gunnar Hjalmarsson about 9 years
    Please note that for gettext compatible applications you need to set LANGUAGE instead of LANG. See example in my answer.
  • Luis Alvarado
    Luis Alvarado over 4 years
    I just tested this and it worked beautifully for a bunch of apps. Kudos Luca.