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 directoriesThe 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 EnglishTo verify es_ES is correctly installed:
$ locale -a | grep es_ES
es_ES.utf8To 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; CastilianTo force re-creating man pages
$ sudo mandb -cAfter 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?
02 Answers
man takes the -L option as well as environment variables as $LC_MESSAGES and $LANG into account, but it can’t display man pages in a language they are not (yet?) translated to. Using find we can easily get a list of available translations, e.g. for cp:
$ find /usr/share/man -name "cp.*"
/usr/share/man/man1/cp.1.gzThat 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:
$ find /usr/share/man -name "man.*"
/usr/share/man/nl/man1/man.1.gz
/usr/share/man/zh_CN/man1/man.1.gz
/usr/share/man/ru/man1/man.1.gz
/usr/share/man/ja/man1/man.1.gz
/usr/share/man/sv/man1/man.1.gz
/usr/share/man/sr/man1/man.1.gz
/usr/share/man/es/man1/man.1.gz
…The list goes on and shows the available languages, es being one of them. You can use one of
LANGUAGE=es_ES.utf8 man man
man -L es_ES.utf8 man
man -Les manto display it. In fact, if the locale environment variables in your terminal are set accordingly man will always display man pages in Spanish and only fall back to English if a Spanish translation is not available, like you experienced with man cp. To set this up, run locale and see if $LANGUAGE is set to es_ES.utf8. If it’s not, add a line LANGUAGE=es_ES.utf8 to your ~/.bashrc or define an alias like alias 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 or with e.g. apt-file list manpages-es. manpages-es and manpages-es-extra look promising, however none of them contains a man page for the cp command.
Since not everybody has disk space for every-language man pages, and since the LANG variable doesn't cause translation, you probably need to install one or more packages:
$ apt-cache search Spanish|grep man
aptitude-doc-es - Spanish manual for aptitude, a terminal-based package manager
drascula-german - classic 2D point and click adventure game -- German version
drgeo-doc - Dr. Geo online user manual
manpages-es - Spanish man pages
manpages-es-extra - Spanish extra manpages
apertium-es-ro - Apertium translation data for the Spanish-Romanian pair 0