I'm trying to see localized error messages. However, I only seem to get the message from the default "C" locale. E.g.
$ cat /etc/shadow
cat: /etc/shadow: Permission denied
$ locale -a|grep fi
fi_FI.utf8
$ LC_MESSAGES=fi_FI.utf8 cat /etc/shadow
cat: /etc/shadow: Permission denied
Furthermore, looking at the ltrace output of cat it does call setlocale(LC_ALL, "")
, and prints the error message with the glibc error() function (which prints the error message returned by strerror(), which should be a localized message).
Looking at the strace output of "LC_MESSAGES=fi_FI.utf8 cat /etc/shadow" one sees that it tries to open the libc message catalog, but for the english locale rather than fi_FI.utf8:
...
open("/usr/share/locale/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en_US/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale-langpack/en/LC_MESSAGES/libc.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
...
I do have a file /usr/share/locale-langpack/fi/LC_MESSAGES/libc.mo which contains the libc message catalog for the fi_FI.utf8 locale, however, it doesn't seem to be used. Packages language-pack-fi, language-pack-fi-base are both installed (as are the corresponding gnome and kde language packs, but I can't see them being relevant here).
What am I missing?