summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-01-30 22:35:25 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-01-30 22:35:25 +0000
commitf8ba0dcf6015f92e962dd1400ddb154f20b606b1 (patch)
tree76f743c1848f5bdd3966b89514c1fe715d03b3e4
parentf5204831c0709c93972d0579a6cdaf19d0df2a9c (diff)
downloaddrakx-f8ba0dcf6015f92e962dd1400ddb154f20b606b1.tar
drakx-f8ba0dcf6015f92e962dd1400ddb154f20b606b1.tar.gz
drakx-f8ba0dcf6015f92e962dd1400ddb154f20b606b1.tar.bz2
drakx-f8ba0dcf6015f92e962dd1400ddb154f20b606b1.tar.xz
drakx-f8ba0dcf6015f92e962dd1400ddb154f20b606b1.zip
now works in normal user: it modifies the ~/.i18n (todo: handle kde crazy variables?)
-rw-r--r--perl-install/standalone/localedrake17
1 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/standalone/localedrake b/perl-install/standalone/localedrake
index cc43ee653..2e26aa414 100644
--- a/perl-install/standalone/localedrake
+++ b/perl-install/standalone/localedrake
@@ -8,12 +8,21 @@ use interactive;
use lang;
use any;
-my $in = 'interactive'->vnew('su');
+my $in = 'interactive'->vnew;
-my ($lang, $langs) = lang::read();
+my $file = $> ? "$ENV{HOME}/.i18n" : '/etc/sysconfig/i18n';
+my ($lang, $langs) = lang::read('', $file);
+$langs = '' if $>;
if ($lang = any::selectLanguage($in, $lang, $langs)) {
- lang::write('', $lang);
- lang::write_langs('', $langs);
+ lang::write('', $lang, $file, $>);
+ lang::write_langs('', $langs) if $langs;
+}
+
+if ($>) {
+ if (my $wm = any::running_window_manager()) {
+ $in->ask_warn('', _("Please relog into %s to activate the changes", ucfirst (lc $wm)), 1);
+ any::ask_window_manager_to_logout($wm);
+ }
}
$in->exit(0);