Short Tip: Start an application in a foreign language

Start an application in a foreign language
Quite often I have the need to start an application in a foreign language. Given that the language is installed for that program all you have to do is via a terminal:

LANG=en_US firefox

For KDE you have to use a slightly different syntax:

KDE_LANG=en_US kwrite

Since these things are entered in a terminal they are forgotten after you’ve closed the terminal.

As a last note: using this way the only application affected by the new LANG is the application started in the same command line. The rest of the session will not be affected!

11 thoughts on “Short Tip: Start an application in a foreign language”

  1. Well, most times it is LC_ALL. But since those are just environment varialbes, it really depends on the program you are going to use.

    I’ll make another slight correction, though: the effects are not gone when you close the terminal. Actually, they are gone once the program is launched. In other words, they only affect the command you write right after the var.

    That is, unless you first set it, and then launch the program.

    $ grep
    Modo de empleo: grep [OPCIÓN]… PATRÓN [FICHERO]…
    Pruebe `grep –help’ para más información.
    $ LC_ALL=C grep
    Usage: grep [OPTION]… PATTERN [FILE]…
    Try `grep –help’ for more information.
    $ grep
    Modo de empleo: grep [OPCIÓN]… PATRÓN [FICHERO]…
    Pruebe `grep –help’ para más información.

    As you see, setting LC_ALL only affects the second sentence, where I use it. In the contrary, it will be persistent if I do it this other way:

    $ LC_ALL=C
    $ grep
    Usage: grep [OPTION]… PATTERN [FILE]…
    Try `grep –help’ for more information.

    Shows the english locale, instead of my default one which is spanish 😛 In this last case, then it would be true that the value assigned to that varialbe would live until the bash session is closed (for example, by closing the terminal emulator/tab). Or by just doing “exec bash”, which would fork and run a new bash instance using the default environment.

  2. Verrrry cool. I tend to have to support my mother in South America and her KDE is in spanish. Bening able to swith digiKam to spanish so easily is fu$%ing great! Thanks for sharing.

  3. My KDE apps have a ‘switch application language’ entry in the Help menu… Seems like an easier solution for KDE apps 😉

    Maybe it’s an Archlinux/KDEMod specific patch, doesn’t seem to be in KDE 4 – yet….

  4. I’ve noticed yesterday that there appears to be a new “application language setting” in KDE4: you can change the language (and fallback language) through “Change application language” in the Help menu (all “If I remember correctly”).
    This was with some kdeedu program, but I guess it’s a more general thing that all KDE applications could use.
    Very convenient, if you want to use some programs in a non-default language always.

  5. jospoortvliet, daniel: I have that one too, but never noticed it before. Interesting!
    However, the short tip is just for temporary switches where you don’t want to restart anything.

    But thanks nevertheless for pointing out!

  6. me: I guess you refer to KDE’s way of using its own variable? If so, please keep in mind that KDE has its own language settings which can be independent from the system’s language.
    So there is indeed sense in using its own variable. Your comment is, however, very stupid since you totally fail to look into the details 🙂

  7. Kubuntu Gutsy has “Switch application language” in most KDE apps, but I noticed for example Krita doesn’t have it. Knowing a command line alternative is nice.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: