summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/localedrake
blob: 2e26aa4145c145f82e7ac638cd9426784458c8b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);

use standalone;     #- warning, standalone must be loaded very first, for 'explanations'

use interactive;
use lang;
use any;

my $in = 'interactive'->vnew;

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, $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);