slitaz-tools rev 170

tazlocale: dispaly locale name
author Christophe Lincoln <pankso@slitaz.org>
date Sun May 04 16:35:33 2008 +0200 (2008-05-04)
parents af16b5d7db36
children 045c9474ee99
files tinyutils/tazlocale
line diff
     1.1 --- a/tinyutils/tazlocale	Sun May 04 12:08:40 2008 +0000
     1.2 +++ b/tinyutils/tazlocale	Sun May 04 16:35:33 2008 +0200
     1.3 @@ -28,6 +28,17 @@
     1.4  	exit 1
     1.5  fi
     1.6  
     1.7 +# Locale name displayed.
     1.8 +get_locale_name()
     1.9 +{
    1.10 +	for i in `locale -a | grep "[a-z]_"`
    1.11 +	do
    1.12 +		name=`locale -a -v | grep -A 2 "locale: $i" | grep "title" | \
    1.13 +			cut -d " " -f 7`
    1.14 +		echo "$i $name"
    1.15 +	done
    1.16 +}
    1.17 +
    1.18  # Dialog menu.
    1.19  #
    1.20  exec 3>&1
    1.21 @@ -35,8 +46,8 @@
    1.22  	--title " SliTaz locale configuration " \
    1.23  	--menu \
    1.24  "Select your language - Séléctionnez votre langue" 15 70 5 \
    1.25 -"en" "Locale" \
    1.26 -$(locale -a | grep ^[a-z] | awk '{ printf "%s Locale\n",$1,$2 }') \
    1.27 +"en" "English" \
    1.28 +$(get_locale_name) \
    1.29  2>&1 1>&3`
    1.30  retval=$?
    1.31  exec 3>&-
    1.32 @@ -65,6 +76,7 @@
    1.33  echo "LANG=$value" > /etc/locale.conf
    1.34  echo "LC_ALL=$value" >> /etc/locale.conf
    1.35  
    1.36 -. /etc/locale.conf && export LANG LC_ALL
    1.37 +. /etc/locale.conf
    1.38 +export LANG LC_ALL
    1.39  
    1.40  exit 0