diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl.pl | 21 | ||||
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 4 |
2 files changed, 23 insertions, 2 deletions
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, diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index ab58318be37..613f7c60a28 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -145,7 +145,7 @@ my %labels = ( binsys => 'Binary System(s)', symlink => 'Install symlinks to system directories', ); -if ($::lang ne "en") { +if (($::lang ne "en") && ($::lang ne "C")) { eval { require("installer/install-menu-perltk-$::lang.pl"); }; if ($@) { # couldn't find the file, continue with english @@ -156,6 +156,8 @@ if ($::lang ne "en") { $destenc = $encodings{$::lang} if defined($encodings{$::lang}); $destenc = $special_win_encodings{$::lang} if defined($special_win_encodings{$::lang}); + $destenc = $::charset if defined($::charset); + print "lang=$::lang, charset=$destenc\n"; foreach my $k (keys %translatedtext) { my $tmp = $translatedtext{$k}; # translation strings are supposed to be in utf8 |