My Ubuntu 18.04 is set to Spanish:
But man pages are displayed in English, not according to the configuration (Spanish).
$ man cp | head -n4
CP(1) User Commands CP(1)
NAME
cp - copy files and directories
The following is what I tried to get man page in Spanish:
$ LANG=es_ES.utf8 man cp # result is in English
$ LANGUAGE=es_ES:es man cp # result is in English
$ man -Les cp # result is in English
$ man --locale=es cp # result is in English
To verify es_ES is correctly installed:
$ locale -a | grep es_ES
es_ES.utf8
To verify the man pages for Spanish is installed:
$ sudo dpkg -l | grep language-pack-es
ii language-pack-es 1:18.04+20180712
all translation updates for language Spanish; Castilian
ii language-pack-es-base 1:18.04+20180712
all translations for language Spanish; Castilian
To force re-creating man pages
$ sudo mandb -c
After all of these, try the first 3 commands and none of them produces man pages in Spanish.
References:
None of the solutions here work:
How can I read man pages in my native language? https://unix.stackexchange.com/questions/283660/how-to-change-the-language-for-man-command https://unix.stackexchange.com/questions/43384/localization-of-man-pages-on-linux-ubuntu
man
takes the-L
option as well as environment variables as$LC_MESSAGES
and$LANG
into account, but it can’t displayman
pages in a language they are not (yet?) translated to. Usingfind
we can easily get a list of available translations, e.g. forcp
:That means there’s only one version, not located in any of the language subdirectories, that’s the default English one. Let’s take a look at results for the
man
command:The list goes on and shows the available languages,
es
being one of them. You can use one ofto display it. In fact, if the locale environment variables in your terminal are set accordingly
man
will always displayman
pages in Spanish and only fall back to English if a Spanish translation is not available, like you experienced withman cp
. To set this up, runlocale
and see if$LANGUAGE
is set toes_ES.utf8
. If it’s not, add a lineLANGUAGE=es_ES.utf8
to your~/.bashrc
or define an alias likealias man='man -Les'
.Catering to waltinators answer there may be additional packages available holding translations, you can take a look at their file lists on https://packages.ubuntu.com or with e.g.
apt-file list manpages-es
.manpages-es
andmanpages-es-extra
look promising, however none of them contains aman
page for thecp
command.Since not everybody has disk space for every-language
man
pages, and since theLANG
variable doesn't cause translation, you probably need to install one or more packages: