Annotation of /tags/installer-0_1_0/ncurses-gui/locales.sh
Parent Directory | Revision Log
Revision 1013 -
(hide annotations)
(download)
(as text)
Sun May 30 17:33:29 2010 UTC (14 years, 4 months ago) by niro
Original Path: trunk/installer/ncurses-gui/locales.sh
File MIME type: application/x-sh
File size: 2037 byte(s)
Sun May 30 17:33:29 2010 UTC (14 years, 4 months ago) by niro
Original Path: trunk/installer/ncurses-gui/locales.sh
File MIME type: application/x-sh
File size: 2037 byte(s)
-added ncurses-gui
1 | niro | 1013 | # $Id$ |
2 | |||
3 | select_timezone_region() | ||
4 | { | ||
5 | local items=( $(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=( $(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=( $(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 | |||
74 | rundialog_select_timezone_location() | ||
75 | { | ||
76 | TIMEZONE_LOCATION=$(select_timezone_location) | ||
77 | case $? in | ||
78 | -1) die "Error!" ;; | ||
79 | 255) die "aborted by user" ;; | ||
80 | |||
81 | 1) | ||
82 | rundialog_select_timezone_region | ||
83 | rundialog_select_timezone_location | ||
84 | ;; | ||
85 | |||
86 | 0) export TIMEZONE_LOCATION ;; | ||
87 | esac | ||
88 | |||
89 | debug "TIMEZONE_LOCATION='${TIMEZONE_LOCATION}'" | ||
90 | } | ||
91 | |||
92 | rundialog_select_locale() | ||
93 | { | ||
94 | LOCALE=$(select_locale) | ||
95 | case $? in | ||
96 | -1) die "Error!" ;; | ||
97 | 255) die "aborted by user" ;; | ||
98 | |||
99 | 1) | ||
100 | rundialog_select_timezone_location | ||
101 | rundialog_select_locale | ||
102 | ;; | ||
103 | |||
104 | 0) export LOCALE ;; | ||
105 | esac | ||
106 | |||
107 | debug "LOCALE='${LOCALE}'" | ||
108 | } | ||
109 | |||
110 | main_locales() | ||
111 | { | ||
112 | rundialog_select_timezone_region | ||
113 | rundialog_select_timezone_location | ||
114 | rundialog_select_locale | ||
115 | } |
Properties
Name | Value |
---|---|
svn:keywords | Id |