summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-11-18 14:41:04 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-11-18 14:41:04 +0000
commit861099c1f2fab024ac279280968082b953f77cc6 (patch)
treee3aa8aefdc804a8a6865afb1a5363372f4fe1c8b /perl-install/lang.pm
parent4be375d2adddc2269aff3678818843db8a91189a (diff)
downloaddrakx-backup-do-not-use-861099c1f2fab024ac279280968082b953f77cc6.tar
drakx-backup-do-not-use-861099c1f2fab024ac279280968082b953f77cc6.tar.gz
drakx-backup-do-not-use-861099c1f2fab024ac279280968082b953f77cc6.tar.bz2
drakx-backup-do-not-use-861099c1f2fab024ac279280968082b953f77cc6.tar.xz
drakx-backup-do-not-use-861099c1f2fab024ac279280968082b953f77cc6.zip
- create i18n_env()
- use it in set() when $::move to set a standard i18n environment, not the drakx simplified one
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm29
1 files changed, 22 insertions, 7 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 0bf4652a9..e5c2d29d7 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -768,8 +768,14 @@ sub l2pango_font {
}
sub set {
- my ($lang, $b_translate_for_console) = @_;
+ my ($locale, $b_translate_for_console) = @_;
+
+ if ($::move) {
+ put_in_hash(\%ENV, i18n_env($locale));
+ return;
+ }
+ my ($lang) = $locale->{lang};
exists $langs{$lang} or log::l("lang::set: trying to set to $lang but I don't know it!"), return;
my $dir = "$ENV{SHARE_PATH}/locale";
@@ -880,10 +886,8 @@ sub write_langs {
substInFile { s/%_install_langs.*//; $_ .= "%_install_langs $s\n" if eof && $s } "$prefix/etc/rpm/macros";
}
-sub write {
- my ($prefix, $locale, $b_user_only, $b_dont_touch_kde_files) = @_;
-
- $locale && $locale->{lang} or return;
+sub i18n_env {
+ my ($locale) = @_;
my $locale_lang = getlocale_for_lang($locale->{lang}, $locale->{country}, $locale->{utf8});
my $locale_country = getlocale_for_country($locale->{lang}, $locale->{country}, $locale->{utf8});
@@ -894,8 +898,19 @@ sub write {
LANGUAGE => getLANGUAGE($locale->{lang}, $locale->{country}, $locale->{utf8}),
(map { $_ => $locale_country } qw(LC_NUMERIC LC_MONETARY LC_ADDRESS LC_MEASUREMENT LC_NAME LC_PAPER LC_IDENTIFICATION LC_TELEPHONE))
};
+
log::l("lang::write: lang:$locale->{lang} country:$locale->{country} locale|lang:$locale_lang locale|country:$locale_country language:$h->{LANGUAGE}");
+ $h;
+}
+
+sub write {
+ my ($prefix, $locale, $b_user_only, $b_dont_touch_kde_files) = @_;
+
+ $locale && $locale->{lang} or return;
+
+ my $h = i18n_env($locale);
+
my ($name, $sfm, $acm) = l2console_font($locale, 0);
if ($name && !$b_user_only) {
my $p = "$prefix/usr/lib/kbd";
@@ -924,10 +939,10 @@ sub write {
}
}
- add2hash $h, $xim{$locale_lang};
+ add2hash $h, $xim{$h->{LANG}};
#- deactivate translations on console for RTL languages
- if ($locale_lang =~ /ar|fa|he|ur|yi/) {
+ if ($h->{LANG} =~ /ar|fa|he|ur|yi/) {
add2hash $h, { CONSOLE_NOT_LOCALIZED => 'yes' }
}