diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-03-01 17:56:32 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-03-01 17:56:32 +0000 |
commit | b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540 (patch) | |
tree | 5dc1c4376baac124b3c223da4d5a73292ce9a1d3 /perl-install | |
parent | 33e516ff5e432a1f76e2d965709c43f3c48fb33d (diff) | |
download | drakx-b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540.tar drakx-b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540.tar.gz drakx-b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540.tar.bz2 drakx-b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540.tar.xz drakx-b4f6f62b291b9ef2ba4f93a4dfff791fd50c7540.zip |
restrict localedrake to installed lang
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/any.pm | 5 | ||||
-rw-r--r-- | perl-install/lang.pm | 13 | ||||
-rw-r--r-- | perl-install/standalone/localedrake | 5 |
3 files changed, 14 insertions, 9 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm index ce7e93feb..591363911 100644 --- a/perl-install/any.pm +++ b/perl-install/any.pm @@ -840,6 +840,9 @@ Do you want to use this feature?"), sub selectLanguage { my ($in, $lang, $langs_) = @_; my $langs = $langs_ || {}; + my @langs = lang::list(exclude_non_necessary_utf8 => $::isInstall, + exclude_non_installed_langs => !$::isInstall, + ); $in->ask_from_( { messages => _("Please choose a language to use."), title => 'language choice', @@ -849,7 +852,7 @@ sub selectLanguage { }, }, [ { val => \$lang, separator => '|', - format => \&lang::lang2text, list => [ lang::list($::isInstall) ] }, + format => \&lang::lang2text, list => \@langs }, if_($langs_, (map {; { val => \$langs->{$_->[0]}, type => 'bool', disabled => sub { $langs->{all} }, text => $_->[1], advanced => 1, diff --git a/perl-install/lang.pm b/perl-install/lang.pm index bd8eb89ba..34f42f07f 100644 --- a/perl-install/lang.pm +++ b/perl-install/lang.pm @@ -432,13 +432,16 @@ my %lang2country = ( #-###################################################################################### sub list { - my ($exclude_non_necessary_utf8) = @_; - if ($exclude_non_necessary_utf8) { + my (%options) = @_; + my @l = @languages; + if ($options{exclude_non_necessary_utf8}) { my %LANGs_non_utf8 = map { lang2LANG($_) => 1 } grep { !/UTF-8/ } @languages; - grep { !/UTF-8/ || !$LANGs_non_utf8{lang2LANG($_)} } @languages; - } else { - @languages; + @l = grep { !/UTF-8/ || !$LANGs_non_utf8{lang2LANG($_)} } @l; + } + if ($options{exclude_non_installed_langs}) { + @l = grep { -e "/usr/share/locale/" . lang2LANG($_) . "/LC_CTYPE" } @l; } + @l; } sub lang2text { exists $languages{$_[0]} && $languages{$_[0]}[0] } sub lang2charset { exists $languages{$_[0]} && $languages{$_[0]}[1] } diff --git a/perl-install/standalone/localedrake b/perl-install/standalone/localedrake index b71f4cff7..fb17348e0 100644 --- a/perl-install/standalone/localedrake +++ b/perl-install/standalone/localedrake @@ -22,12 +22,11 @@ if ($klang) { #- help KDE defaulting to the right charset print lang::charset2kde_charset(lang::lang2charset($lang)), "\n"; } else { - my ($lang, $langs) = lang::read('', $>); + my ($lang) = lang::read('', $>); my $in = 'interactive'->vnew; - if ($lang = any::selectLanguage($in, $lang, $langs)) { + if ($lang = any::selectLanguage($in, $lang)) { lang::write('', $lang, $>); - lang::write_langs('', $langs) if $langs; if ($>) { if (my $wm = any::running_window_manager()) { $in->ask_okcancel('', _("The change is done, but to be effective you must logout"), 1) |