slitaz-tools diff tinyutils/tazkeymap @ rev 623
gettextize tazkeymap and make pot
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Tue Jun 14 22:35:33 2011 +0200 (2011-06-14) |
parents | cd1c6f4ddeb3 |
children | 41b3ae3aff8b |
line diff
1.1 --- a/tinyutils/tazkeymap Fri Apr 29 21:21:10 2011 +0200 1.2 +++ b/tinyutils/tazkeymap Tue Jun 14 22:35:33 2011 +0200 1.3 @@ -7,11 +7,15 @@ 1.4 # 1.5 : ${DIALOG=dialog} 1.6 1.7 +# Internationalization 1.8 +. /usr/bin/gettext.sh 1.9 +TEXTDOMAIN='slitaz-tools' 1.10 +export TEXTDOMAIN 1.11 + 1.12 # Check if user is root. 1.13 -# 1.14 if test $(id -u) != 0; then 1.15 - echo -e "\nYou must be root to run `basename $0`!" 1.16 - echo -e "Type 'su' and root password to become super-user.\n" 1.17 + gettext "You must be root to run:"; echo " $(basename $0)" 1.18 + gettext "Type su and root password to become super-user"; echo 1.19 exit 1 1.20 fi 1.21 1.22 @@ -46,8 +50,8 @@ 1.23 # Default to text mode dialog. 1.24 exec 3>&1 1.25 value=`$DIALOG --clear \ 1.26 - --title " SliTaz keymap configuration " \ 1.27 - --menu "\nPlease select your keymap, current config: $CUR" 15 70 5 \ 1.28 + --title " $(gettext "SliTaz keymap configuration") " \ 1.29 + --menu "" 15 70 5 \ 1.30 "us" "USA" \ 1.31 "fr_CH-latin1" "Suisse Romande" \ 1.32 "fr-latin1" "France" \ 1.33 @@ -82,26 +86,16 @@ 1.34 retval=$? 1.35 exec 3>&- 1.36 case $retval in 1.37 - 0) 1.38 - continue ;; 1.39 - 1) 1.40 - echo "Cancel pressed." 1.41 - exit 0 ;; 1.42 - 255) 1.43 - if test -n "$value" ; then 1.44 - echo "$value" 1.45 - else 1.46 - echo "ESC pressed." 1.47 - exit 0 1.48 - fi ;; 1.49 + 0) continue ;; 1.50 + 1|255) exit 0 ;; 1.51 esac 1.52 # If it's a reconfiguration give an info message. 1.53 if [ -s /etc/keymap.conf ]; then 1.54 + msg=$(gettext "\ 1.55 +Please logout of your current session and login again to use new keyboard.") 1.56 $DIALOG --clear \ 1.57 - --title " Keyboard mapping information\n" \ 1.58 - --msgbox " 1.59 - Please logout of your current session and login again to use $value 1.60 - keyboard.\n" 16 70 1.61 + --title " Information " \ 1.62 + --msgbox "$msg" 16 70 1.63 fi 1.64 kmap=$value 1.65 echo "$kmap" > /etc/keymap.conf