From 485c4b69dfd36ce1c6b800935f7ce4a7aa1c95a9 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sat, 19 Jan 2008 17:53:56 +0000 Subject: for unix: automatic language selection ... try LC_CTYPE=de_AT.latin1 perl install-tl.pl -gui or LC_CTYPE=it_IT.utf8 perl install-tl.pl -gui git-svn-id: svn://tug.org/texlive/trunk@6321 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'Master/install-tl.pl') diff --git a/Master/install-tl.pl b/Master/install-tl.pl index 50295da8b52..5100203d9d2 100755 --- a/Master/install-tl.pl +++ b/Master/install-tl.pl @@ -49,6 +49,25 @@ use TeXLive::TLConfig qw($DefaultContainerExtension $InfraLocation); use TeXLive::TLWinGoo; use Getopt::Long; +# default language +$::lang = "en"; +$::charset = "latin1"; +if ($^O !~ /^MSWin(32|64)$/i) { + # we load POSIX and locale stuff + require POSIX; + import POSIX qw/locale_h/; + # now we try to deduce $::charset and $::lang + my $loc = setlocale(&POSIX::LC_CTYPE); + my ($lang,$area,$codeset); + if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) { + $lang = defined($1)?$1:""; + $area = defined($3)?$3:""; + $codeset = defined($5)?$5:""; + } + $::lang = $lang if ($lang); + $::charset = $codeset if ($codeset); +} + use strict; # debugging/logging cmd lines options: @@ -121,7 +140,6 @@ my $opt_quiet = 0; my $opt_qquiet = 0; $::netarchive = "archive"; $::diskarchive = "archive"; -$::lang = "en"; GetOptions("media=s" => \$opt_media, "profile=s"=> \$opt_profile, @@ -130,6 +148,7 @@ GetOptions("media=s" => \$opt_media, "netarchive=s" => \$::netarchive, "diskarchive=s" => \$::diskarchive, "lang=s" => \$::lang, + "charset=s" => \$::charset, "d" => \$opt_debug, "dd" => \$opt_ddebug, "ddd" => \$opt_dddebug, -- cgit v1.2.3