diff options
| author | Dima Panov <fluffy@FreeBSD.org> | 2026-10-26 20:07:56 +0000 |
|---|---|---|
| committer | Dima Panov <fluffy@FreeBSD.org> | 2026-10-27 22:04:44 +0000 |
| commit | 9fe7f514ef249372afe78773c230a8f9e13cb672 (patch) | |
| tree | 221ca1652668d683905da3178d82a56ead922111 | |
| parent | acab75276db8925883a2e71208a9e2d4f8392170 (diff) | |
usr.bin/man: allow man(1) to search translated manpages in pure $man_lang subdirectory (+)
Currently our man(1) utility search manages only in $lang_country.$charset, $lang.$charset and,
as failover, in en.$charset which is historical behavior.
But nowadays most of ported software uses only $lang subdirectories for translated manpages
instead of use full locale notation, for example, share/ja/man1, share/de/man1, share/ru/man1.
In such cases, our man(1) utility cannot find any translated manpages and silently fallback to english version.
Add $man_lang in search path allows man(1) search and use translated manpages under historical and modern path traditions
MFC after: 1 day
MFC to: stable/15 stable/14
Reviewed by: ziaee, fernape
Approved by: fernape
Differential Revision: https://reviews.freebsd.org/D55805
(cherry picked from commit 5250c98908482babae8379b4dede10c64e8639ae)
| -rw-r--r-- | usr.bin/man/man.1 | 4 | ||||
| -rwxr-xr-x | usr.bin/man/man.sh | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/man/man.1 b/usr.bin/man/man.1 index 707677ccce06..43c1d4c15056 100644 --- a/usr.bin/man/man.1 +++ b/usr.bin/man/man.1 @@ -225,6 +225,8 @@ will search for locale specific manual pages using the following logic: .It .Va lang . Ns Va charset .It +.Va lang +.It .Li en . Ns Va charset .El .Pp @@ -242,6 +244,8 @@ will search the following paths when considering section 1 manual pages in .It .Pa /usr/share/man/ja.eucJP/man1 .It +.Pa /usr/share/man/ja/man1 +.It .Pa /usr/share/man/en.eucJP/man1 .It .Pa /usr/share/man/man1 diff --git a/usr.bin/man/man.sh b/usr.bin/man/man.sh index 920223ce3c27..f10209544ba7 100755 --- a/usr.bin/man/man.sh +++ b/usr.bin/man/man.sh @@ -748,7 +748,7 @@ man_setup_locale() { man_country="${lang_cc#*_}" man_charset="${locstr#*.}" locpaths="$locstr" - locpaths="$locpaths:$man_lang.$man_charset" + locpaths="$locpaths:$man_lang.$man_charset:$man_lang" if [ "$man_lang" != "en" ]; then locpaths="$locpaths:en.$man_charset" fi |
