tazpkg rev 942
modules/help: display help in language according to environment variables LANGUAGE and LANG - fix bug#173 - thanks HGT
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sun Feb 12 04:41:23 2017 +0200 (2017-02-12) |
parents | bc02a72abd85 |
children | 50421cb50644 |
files | modules/help |
line diff
1.1 --- a/modules/help Fri Feb 10 00:44:26 2017 +0200 1.2 +++ b/modules/help Sun Feb 12 04:41:23 2017 +0200 1.3 @@ -6,6 +6,17 @@ 1.4 1.5 . /lib/libtaz.sh 1.6 1.7 +# Determine the help language 1.8 + 1.9 +BASE='/usr/share/doc/tazpkg' 1.10 + 1.11 +for i in $(echo $LANGUAGE | tr ':' ' ') ${LANG%.*} ${LANG%_*} en; do 1.12 + if [ -f "$BASE/tazpkg.$i.html" ]; then 1.13 + DOC="$BASE/tazpkg.$i.html" 1.14 + break 1.15 + fi 1.16 +done 1.17 + 1.18 1.19 1.20 1.21 @@ -82,7 +93,6 @@ 1.22 1.23 1.24 T="${1#-}" 1.25 -DOC='/usr/share/doc/tazpkg/tazpkg.html' 1.26 QUERY="$T" 1.27 1.28 if [ -z "$T" ]; then