Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to run an application in another language as my current environment. To start out simple, I wanted to change the language of ls.

Here's what I read all over the place (see below for related questions): set LANG to one of the supported locales, e.g.:

LANG=nl_NL.UTF-8 ls /nonexistent

to have it show Dutch (NL) output.

However, I still get English output:

$ LANG=nl_NL.UTF-8 ls -al /nonexistent
ls: cannot access /nonexistent: No such file or directory

My current environment:

$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

To be sure, I've checked:

  • The locale is supported:

    $ grep nl_NL /usr/share/i18n/SUPPORTED 
    nl_NL.UTF-8 UTF-8
    nl_NL ISO-8859-1
    nl_NL@euro ISO-8859-15
    
  • The locale is generated:

    sudo locale-gen nl_NL.UTF-8
    

    and sudo dpkg-reconfigure locales also shows it's generated.

  • Installed the Dutch language pack (already installed):

    sudo apt-get install language-pack-nl
    

What else have I tried?

  • Using export to set both LANG and LANGUAGE instead of prepending the command.
  • Setting also LC_ALL.

Ironically, some (only some!) GUI applications are actually in Dutch, but I haven't configured that at all!

enter image description here

I'm on Kubuntu 12.04(.2), as far as that matters.

Similar questions (to no avail):

What's wrong on my system? Where to debug this further?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Because LANGUAGE, which takes precedence over LANG, is set and unchanged.

$ LANGUAGE=nl ls /nonexistent
ls: kan geen toegang krijgen tot /nonexistent: Bestand of map bestaat niet

More info is in the GNU gettext documentation:

GNU gettext gives preference to LANGUAGE over LC_ALL and LANG for the purpose of message handling, but you still need to have LANG (or LC_ALL) set to the primary language; this is required by other parts of the system libraries.

share|improve this answer
    
I'd swear I had tried this already. Yet, looking at my shell history, I think this is because I only tried this before generating the locale. Could you include a source for why "LANGUAGE takes precedence over LANG"? Thanks for the heads up. –  gertvdijk Jun 23 '13 at 16:03
    

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.