1

I'm running KDE Arch linux and trying to update my system using pacman and have it output in Dutch.

I've tried the following

sudo LANG=nl_NL.UTF-8 pacman -Syy
sudo KDE_LANG=nl_NL.UTF-8 pacman -Syy

But neither of them worked.

I've also tried editing my /etc/locale.gen file and running locale-gen but that didn't work either.

I know pacman supports localization, but I can't seem to get it to output in any of the major languages.

  • Just to make sure, is your LANG set correctly in /etc/locale.conf? And you'd try to run this: LANG=nl_NL.UTF-8 sudo pacman -Syy. – Risto Salminen Dec 24 '13 at 7:13
  • LANG is set to en_US.UTF-8, so I don't think there's any troubles there. I'm not trying to set anything else to Dutch just trying to get pacman to output in it. – Joshua Strot Dec 24 '13 at 7:18
  • Ah, now I see what you meant. – Risto Salminen Dec 24 '13 at 7:22
2

The locale variable to control the language of a program is LC_MESSAGES. The variable LANG is a fallback when more specific LC_xxx settings are not present. So if you already have LC_MESSAGES=en_US set (for example), changing LANG won't have the desired effect. In any case, if you want Dutch messages but not otherwise Dutch settings, LC_MESSAGES is what you need to set.

sudo LC_CTYPE=nl_NL.UTF-8 pacman -Syy

Note that LC_ALL trumps all; you should never set it except as LC_ALL=C in programs where you want to ignore ambient locale settings. Also, LANGUAGE is a GNU libc feature which can override even LC_ALL, so make sure to unset it.

  • That works, thank you. I had no idea how complicated this was going to become... – Joshua Strot Dec 25 '13 at 0:19
-1

I think sudo doesn't export your variables, check this:

# sudo FOO=bar echo ${FOO}

#

Maybe should create a script with LANG=nl_NL.UTF-8 pacman $* and call this script with sudo.

  • No, that also doesn't work unfortunately. When using a command with sudo, you pass it before the command, so it doesn't set the variable for sudo sudo [-AbEHnPS] [-C fd] [-g group name|#gid] [-p prompt] [-r role] [-t type] [-u user name|#uid] [VAR=value] [-i | -s] [command] – Joshua Strot Dec 24 '13 at 7:32
  • Hm, indeed. But why doesn't work my example? – uzsolt Dec 24 '13 at 8:00
  • To be honest I'm not sure. I've tried it multiple ways, even using LC_ALL but none of them work. I before figured I was running the command wrong, but after alot of discussion on this topic at SO I arrived the decision there might be something wrong with the localization portion of my system. – Joshua Strot Dec 24 '13 at 8:05
  • No, sudo FOO=bar somecommand does set FOO when running somecommand. But in your code snippet, the command that you pass to sudo is echo with no argument, because ${FOO} is expanded by the shell that you run sudo from. Try sudo FOO=bar sh -c 'echo $FOO' (pay attention to the quoting) or sudo FOO=bar env. – Gilles Dec 25 '13 at 0:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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