summaryrefslogtreecommitdiffstats
path: root/perl-install/lang.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-03-06 11:33:01 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-03-06 11:33:01 +0000
commitf03ae92232e5695968b76f38a0935d1ca758cbcc (patch)
tree57dfd8824cdf344fce8b21995d4fd2650933b2de /perl-install/lang.pm
parent4b56b716e9c1db1d354754fcde2ae780efbe07d5 (diff)
downloaddrakx-f03ae92232e5695968b76f38a0935d1ca758cbcc.tar
drakx-f03ae92232e5695968b76f38a0935d1ca758cbcc.tar.gz
drakx-f03ae92232e5695968b76f38a0935d1ca758cbcc.tar.bz2
drakx-f03ae92232e5695968b76f38a0935d1ca758cbcc.tar.xz
drakx-f03ae92232e5695968b76f38a0935d1ca758cbcc.zip
- create the kde share/config's directory, so that kde config files are created in any case
- in user_only localedrake, ensure the /etc/sysconfig/i18n is taken into account when ~/.i18n doesn't exist (thanks to F.Crozat)
Diffstat (limited to 'perl-install/lang.pm')
-rw-r--r--perl-install/lang.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/lang.pm b/perl-install/lang.pm
index 34f42f07f..ddb386d07 100644
--- a/perl-install/lang.pm
+++ b/perl-install/lang.pm
@@ -679,8 +679,8 @@ sub unpack_langs {
sub read {
my ($prefix, $user_only) = @_;
- my $file = $prefix . ($user_only ? "$ENV{HOME}/.i18n" : '/etc/sysconfig/i18n');
- my %h = getVarsFromSh("$prefix$file");
+ my ($f1, $f2) = ("$prefix$ENV{HOME}/.i18n", "$prefix/etc/sysconfig/i18n");
+ my %h = getVarsFromSh($user_only && -e $f1 ? $f1 : $f2);
my $lang = $h{LC_MESSAGES} || 'en_US';
$lang = bestMatchSentence($lang, list()) if !exists $languages{$lang};
my $langs = $user_only ? () :
@@ -741,6 +741,9 @@ sub write {
my $charset = lang2charset($lang);
my $confdir = $prefix . ($user_only ? "$ENV{HOME}/.kde" : '/usr') . '/share/config';
my ($prev_kde_charset) = cat_("$confdir/kdeglobals") =~ /^Charset=(.*)/mi;
+
+ mkdir_p($confdir);
+
update_gnomekderc("$confdir/kdeglobals", Locale => (
Charset => charset2kde_charset($charset),
Country => lang2country($lang, $prefix),