summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/localedrake
blob: ea40a99d0e8b22703fae9812303e3663b44fb4f7 (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
29
30
31
32
33
34
35
#!/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;


if ($ARGV[0] =~ /--kde_country=(.*)/) {
    my $lang = lang::country2lang($1);
    lang::write('', $lang, $>);

    #- help KDE defaulting to the right charset
    print lang::charset2kde_charset(lang::lang2charset($lang)), "\n";
} else {
    my ($lang, $langs) = lang::read('', $>);

    my $in = 'interactive'->vnew;
    if ($lang = any::selectLanguage($in, $lang, $langs)) {
	lang::write('', $lang, $>);
	lang::write_langs('', $langs) if $langs;
	if ($>) {
	    if (my $wm = any::running_window_manager()) {
		$in->ask_okcancel('', _("The change is done, but to be effective you must logout"), 1)
		  && any::ask_window_manager_to_logout($wm);
	    }
	}
    }
    $in->exit(0);
}