summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/localedrake
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-02-08 22:09:29 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-02-08 22:09:29 +0000
commit7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9 (patch)
tree71e2baa4516d151f4462c692502a3a7dff5ef4df /perl-install/standalone/localedrake
parentdd9a661c53728a4ea265882a1029c9b323cd6d3c (diff)
downloaddrakx-7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9.tar
drakx-7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9.tar.gz
drakx-7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9.tar.bz2
drakx-7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9.tar.xz
drakx-7fa65d931c24bd00a7d9ec9b26adaf7ad80023b9.zip
language/country selection change:
- first install step is selection of your language, in your language; it uses images for that - language->country is probed, the selection of the country is possible if there was a problem, in the Summary step - in the $o big structure, we now use $o->{locale} which contains three keys: lang, country and utf8 - lang.pm has been cleaned and rewritten a bit - keyboard probing now done only on language (because this step is at the beginning of the install) - timezone probing done on country, if use changes country before timezone in the Summary, re-probe timezone accordingly
Diffstat (limited to 'perl-install/standalone/localedrake')
-rw-r--r--perl-install/standalone/localedrake31
1 files changed, 18 insertions, 13 deletions
diff --git a/perl-install/standalone/localedrake b/perl-install/standalone/localedrake
index 13b18027b..66bcc05bf 100644
--- a/perl-install/standalone/localedrake
+++ b/perl-install/standalone/localedrake
@@ -14,28 +14,33 @@ my ($klang, $country, $apply);
foreach (@ARGV) {
$apply = /--apply/;
$klang = $1 if /--kde_lang=(.*)/;
- $country = $1 if /--kde_country=(.*)/;
+ $kcountry = uc($1) if /--kde_country=(.*)/;
}
if (defined $klang) {
$klang or exit;
- my $lang = lang::kde_lang_country2lang($klang, $country);
- lang::write('', $lang, $>, 'dont_touch_kde_files') if $apply;
+ my $lang = member($klang, lang::list_langs()) ? $klang : 'en_US';
+ my $country = member($kcountry, lang::list_countries()) ? $kcountry : 'US';
+ my $locale = lang::read('', $>);
+ $klang and $locale->{lang} = $lang;
+ $kcountry and $locale->{country} = $country;
+ lang::write('', $locale, $>, 'dont_touch_kde_files') if $apply;
#- help KDE defaulting to the right charset
- print lang::charset2kde_charset(lang::lang2charset($lang)), "\n";
+ print lang::charset2kde_charset(lang::l2charset($lang)), "\n";
} else {
- my ($lang) = lang::read('', $>);
-
+ my $locale = lang::read('', $>);
my $in = 'interactive'->vnew;
- if ($lang = any::selectLanguage($in, $lang)) {
- lang::write('', $lang, $>);
- if ($>) {
- if (my $wm = any::running_window_manager()) {
- $in->ask_okcancel('', N("The change is done, but to be effective you must logout"), 1)
- && any::ask_window_manager_to_logout($wm);
- }
+ select_language:
+ $locale->{lang} = any::selectLanguage($in, $locale->{lang}) or goto the_end;
+ any::selectCountry($in, $locale) or goto select_language;
+ lang::write('', $locale, $>);
+ if ($>) {
+ if (my $wm = any::running_window_manager()) {
+ $in->ask_okcancel('', N("The change is done, but to be effective you must logout"), 1)
+ and any::ask_window_manager_to_logout($wm);
}
}
+the_end:
$in->exit(0);
}