tinycm diff index.cgi @ rev 57
Fix i18n
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat Jan 25 14:23:23 2014 +0100 (2014-01-25) |
parents | 8a26630ccceb |
children | 8d24e0cbcdab |
line diff
1.1 --- a/index.cgi Sat Jan 25 13:16:04 2014 +0100 1.2 +++ b/index.cgi Sat Jan 25 14:23:23 2014 +0100 1.3 @@ -8,7 +8,7 @@ 1.4 1.5 # Let's have a peer site config file with a .cgi extension so content 1.6 # is secure even if left in a web server directory. 1.7 -. config.cgi 1.8 +. ./config.cgi 1.9 1.10 tiny="$PWD" 1.11 content="content" 1.12 @@ -26,14 +26,11 @@ 1.13 for lang in $HTTP_ACCEPT_LANGUAGE 1.14 do 1.15 lang=${lang%;*} lang=${lang# } lang=${lang%-*} 1.16 - if echo "$po" | fgrep -q "$lang"; then 1.17 - break 1.18 - fi 1.19 case "$lang" in 1.20 - en) lang="C" ;; 1.21 - fr) lang="fr_FR" ;; 1.22 - pt) lang="pt_BR" ;; 1.23 - ru) lang="ru_RU" ;; 1.24 + en) lang="C" && break ;; 1.25 + fr) lang="fr_FR" && break ;; 1.26 + pt) lang="pt_BR" && break ;; 1.27 + ru) lang="ru_RU" && break ;; 1.28 esac 1.29 done 1.30 unset IFS 1.31 @@ -51,12 +48,12 @@ 1.32 # Used by edit to display language name and the language box. This is 1.33 # for CM content not gettext support. 1.34 get_lang() { 1.35 - lang=$(echo $d | cut -d "/" -f 1) 1.36 - doc=${d#$lang/} 1.37 + dlang=$(echo $d | cut -d "/" -f 1) 1.38 + doc=${d#$dlang/} 1.39 echo '<div id="lang">' 1.40 for l in $LANGUAGES 1.41 do 1.42 - case $lang in 1.43 + case $dlang in 1.44 en) i18n="English" ;; 1.45 fr) i18n="Français" ;; 1.46 pt) i18n="Português" ;; 1.47 @@ -704,6 +701,7 @@ 1.48 Cache : $cachesize 1.49 Mercurial : $hg 1.50 </pre> 1.51 + 1.52 <h3>Admin users</h3> 1.53 EOT 1.54 # Get the list of administrators