From f8ba0dcf6015f92e962dd1400ddb154f20b606b1 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 30 Jan 2002 22:35:25 +0000 Subject: now works in normal user: it modifies the ~/.i18n (todo: handle kde crazy variables?) --- perl-install/standalone/localedrake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'perl-install/standalone/localedrake') 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); -- cgit v1.2.1