Contents of /trunk/installer/ncurses-gui/locales.sh
Parent Directory | Revision Log
Revision 1035 -
(show annotations)
(download)
(as text)
Sun May 30 18:37:54 2010 UTC (14 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 2087 byte(s)
Sun May 30 18:37:54 2010 UTC (14 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 2087 byte(s)
-code cleanup
1 | # $Id$ |
2 | |
3 | select_timezone_region() |
4 | { |
5 | local items=( $(${INSTALLER_DIR}/include/timezone.sh --regions) ) |
6 | local count=${#items[*]} |
7 | local i |
8 | |
9 | dialog \ |
10 | --stdout \ |
11 | --colors \ |
12 | --title "Setup TZ-Data" \ |
13 | --backtitle "${TITLE}" \ |
14 | --menu "Select a Region" \ |
15 | 0 0 ${count} \ |
16 | $(for (( i=0; i<count; i++ )); do echo "${items[$i]} ."; done) |
17 | |
18 | return $? |
19 | } |
20 | |
21 | select_timezone_location() |
22 | { |
23 | local items=( $(${INSTALLER_DIR}/include/timezone.sh --locations ${TIMEZONE_REGION}) ) |
24 | local count=${#items[*]} |
25 | local i |
26 | |
27 | dialog \ |
28 | --stdout \ |
29 | --colors \ |
30 | --title "Setup TZ-Data" \ |
31 | --backtitle "${TITLE}" \ |
32 | --menu "Select a Location" \ |
33 | 0 0 ${count} \ |
34 | $(for (( i=0; i<count; i++ )); do echo "${items[$i]} ."; done) |
35 | |
36 | return $? |
37 | } |
38 | |
39 | select_locale() |
40 | { |
41 | local items=( $(${INSTALLER_DIR}/localedef --list-archive | grep $(include/timezone.sh --get-code ${TIMEZONE_LOCATION})) ) |
42 | local count=${#items[*]} |
43 | local i |
44 | |
45 | dialog \ |
46 | --stdout \ |
47 | --colors \ |
48 | --backtitle "${TITLE}" \ |
49 | --menu "Select a default locale" \ |
50 | 0 0 ${count} \ |
51 | $(for (( i=0; i<count; i++ )); do echo "${items[$i]} ."; done) |
52 | |
53 | return $? |
54 | } |
55 | |
56 | rundialog_select_timezone_region() |
57 | { |
58 | TIMEZONE_REGION=$(select_timezone_region) |
59 | case $? in |
60 | -1) die "Error!" ;; |
61 | 255) die "aborted by user" ;; |
62 | |
63 | 1) |
64 | rundialog_select_timezone_region |
65 | ;; |
66 | |
67 | 0) export TIMEZONE_REGION ;; |
68 | esac |
69 | |
70 | debug "TIMEZONE_REGION='${TIMEZONE_REGION}'" |
71 | } |
72 | |
73 | rundialog_select_timezone_location() |
74 | { |
75 | TIMEZONE_LOCATION=$(select_timezone_location) |
76 | case $? in |
77 | -1) die "Error!" ;; |
78 | 255) die "aborted by user" ;; |
79 | |
80 | 1) |
81 | rundialog_select_timezone_region |
82 | rundialog_select_timezone_location |
83 | ;; |
84 | |
85 | 0) export TIMEZONE_LOCATION ;; |
86 | esac |
87 | |
88 | debug "TIMEZONE_LOCATION='${TIMEZONE_LOCATION}'" |
89 | } |
90 | |
91 | rundialog_select_locale() |
92 | { |
93 | LOCALE=$(select_locale) |
94 | case $? in |
95 | -1) die "Error!" ;; |
96 | 255) die "aborted by user" ;; |
97 | |
98 | 1) |
99 | rundialog_select_timezone_location |
100 | rundialog_select_locale |
101 | ;; |
102 | |
103 | 0) export LOCALE ;; |
104 | esac |
105 | |
106 | debug "LOCALE='${LOCALE}'" |
107 | } |
108 | |
109 | main_locales() |
110 | { |
111 | rundialog_select_timezone_region |
112 | rundialog_select_timezone_location |
113 | rundialog_select_locale |
114 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |