# HG changeset patch # User Aleksej Bobylev # Date 1337256195 -10800 # Node ID f7ff0751c09819d7b25e193fff04d9e04271b475 # Parent 42367a53cf50f0a3959d983ef674621fec9643cf new locale chooser diff -r 42367a53cf50 -r f7ff0751c098 settings.cgi --- a/settings.cgi Thu May 17 14:52:15 2012 +0300 +++ b/settings.cgi Thu May 17 15:03:15 2012 +0300 @@ -175,6 +175,72 @@ EOT ;; + + + *\ locale*) + # + # Choose locale + # + LOADING_MSG="$(gettext 'Please wait...')" + loading_msg + cur_loc=$(locale | grep LANG | cut -d= -f2) + cat <$(gettext 'Choose locale') + +

$(gettext 'Current locale settings:')

+
$(locale)
+ +

$(gettext 'Locales that are currently installed on the machine:')

+
$(locale -a)
+ +

$(gettext 'Available locales:')

+ +
+
+ + + + + + + + +
$(gettext 'Code')$(gettext 'Language')$(gettext 'Territory')$(gettext 'Description')
+ +
+ + + + + + +EOT + for locale in $(find /usr/share/i18n/locales -type f | sort) + do + locale_name=$(basename $locale) + locale_title=$(grep -m 1 -e '^ *title' $locale | cut -d'"' -f2) + if [ -n "$locale_title" ]; then + sel=""; [ "$locale_name" == "$cur_loc" ] && sel="checked" + cat << EOT + + + + + +EOT + fi + done + cat << EOT + +
$locale_name$(gettext -d iso_639 "$(grep -m 1 -e '^ *language' $locale | cut -d '"' -f2)")$(gettext -d iso_3166 "$(grep -m 1 -e '^ *territory' $locale | cut -d '"' -f2)")$locale_title
+
+
+

+
+EOT + ;; + + *) # # Defaut system settings page @@ -193,7 +259,8 @@

$(gettext 'System time')

- +
$(gettext 'Time zome:')$(cat /etc/TZ)
$(gettext 'Time zome:')$(cat /etc/TZ) + $(gettext 'Change')
$(gettext 'System time:')$(date)
$(gettext 'Hardware clock:')$(hwclock -r)
@@ -220,19 +287,11 @@ eval_gettext "You must logout and login again to your current \ session to use \$new_locale locale." else - gettext 'Current system locales:' - locale -a + gettext 'Current system locale:'; echo -n " " + locale | grep LANG | cut -d= -f2 fi cat << EOT -

-
- $(gettext 'Available locales:') - - -
+
$(gettext 'Change')