slitaz-tools rev 568
Make tazlocale usable from cmdline
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Fri Apr 29 11:27:26 2011 +0200 (2011-04-29) |
parents | 1fca224b5cf2 |
children | 6da712ba04f2 |
files | tinyutils/tazkeymap tinyutils/tazlocale |
line diff
1.1 --- a/tinyutils/tazkeymap Thu Apr 28 14:01:29 2011 +0200 1.2 +++ b/tinyutils/tazkeymap Fri Apr 29 11:27:26 2011 +0200 1.3 @@ -1,26 +1,13 @@ 1.4 #!/bin/sh 1.5 # 1.6 # Tazkeymap - SliTaz GNU/Linux keymap config using loadkeys and dialog boxes. 1.7 -# Configuration file is : /etc/kbd.conf 1.8 +# Configuration file is : /etc/keymap.conf 1.9 # 1.10 -# (C) SliTaz GNU/Linux - 20080427 <pankso@slitaz.org> - GNU gpl. 1.11 +# (C) SliTaz GNU/Linux - 2011 <pankso@slitaz.org> - GNU gpl. 1.12 # 1.13 -: ${DIALOG=tazdialog} 1.14 +: ${DIALOG=dialog} 1.15 export ICON="accessories-character-map" 1.16 1.17 -# Script functions. 1.18 -status() 1.19 -{ 1.20 - local CHECK=$? 1.21 - echo -en "\\033[70G[ " 1.22 - if [ $CHECK = 0 ]; then 1.23 - echo -en "\\033[1;33mOK" 1.24 - else 1.25 - echo -en "\\033[1;31mFailed" 1.26 - fi 1.27 - echo -e "\\033[0;39m ]" 1.28 -} 1.29 - 1.30 # Check if user is root. 1.31 # 1.32 if test $(id -u) != 0; then
2.1 --- a/tinyutils/tazlocale Thu Apr 28 14:01:29 2011 +0200 2.2 +++ b/tinyutils/tazlocale Fri Apr 29 11:27:26 2011 +0200 2.3 @@ -3,7 +3,7 @@ 2.4 # Tazlocale: SliTaz GNU/Linux locale setting using dialog boxes. 2.5 # Configuration file is : /etc/locale.conf 2.6 # 2.7 -# 20100201 <pankso@slitaz.org> - GNU gpl. 2.8 +# 20110429 <pankso@slitaz.org> - GNU gpl. 2.9 # 2.10 2.11 # Check if user is root. 2.12 @@ -48,7 +48,7 @@ 2.13 ln -s index.$LANGUAGE.html index.html 2.14 fi 2.15 # SliTaz Software Manuals 2.16 - for soft in tazpkg tazlito tazusb tazwok 2.17 + for soft in tazpkg tazlito tazusb tazwok burnbox tazweb 2.18 do 2.19 if [ -f /usr/share/doc/$soft/$soft.$LANGUAGE.html ]; then 2.20 cd /usr/share/doc/$soft && rm -f $soft.html 2.21 @@ -60,10 +60,9 @@ 2.22 # Locale name displayed. 2.23 get_locale_name() 2.24 { 2.25 - for i in `ls -1 /usr/share/i18n/locales/ | grep ^[a-z][a-z]_[A-Z][A-Z]` 2.26 + for i in `ls -1 /usr/share/i18n/locales | grep ^[a-z][a-z]_[A-Z][A-Z]` 2.27 do 2.28 - #name=`locale -a -v | grep -A 2 "locale: $i" | grep "title" | \ 2.29 - # cut -d " " -f 7` 2.30 + #desc=$(grep ^title /usr/share/i18n/locales/$i | cut -d '"' -f 2) 2.31 echo "$i Locale" 2.32 done 2.33 } 2.34 @@ -122,12 +121,17 @@ 2.35 *_*) 2.36 # Execute functions (can be called from an other apps). 2.37 $1 ;; 2.38 - link-files) 2.39 - link_language_files ;; 2.40 list) 2.41 echo "" 2.42 locale -a 2.43 echo "" ;; 2.44 + init) 2.45 + # This command can be used to change system locale from cmdline. 2.46 + locale=$2 2.47 + echo "LANG=$locale" > /etc/locale.conf 2.48 + echo "LC_ALL=$locale" >> /etc/locale.conf 2.49 + gen_utf8_locale 2.50 + link_language_files ;; 2.51 *) 2.52 : ${DIALOG=dialog} 2.53 dialog_menu