diff options
author | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-03-13 23:28:54 +0000 |
---|---|---|
committer | Reinhard Kotucha <reinhard.kotucha@web.de> | 2008-03-13 23:28:54 +0000 |
commit | 597f8841cbe80679e58f82a35b6293c058c55f4c (patch) | |
tree | af10f2a44168c1ec45ff953f146627704bd5b4e9 /Master/tlpkg | |
parent | b3800b347bc2a1009b4a215901db175f2b40e588 (diff) |
installer: load system dependent stuff only if needed.
git-svn-id: svn://tug.org/texlive/trunk@6957 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index ea9f3696348..f2a7c87504a 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -32,6 +32,29 @@ my $return = $MENU_INSTALL; require Tk; require Tk::Dialog; require Tk::PNG; +use utf8; +no utf8; + +if ($^O =~ /^MSWin(32|64)$/i) { + # trying to deduce automatically the country code + my $foo = TeXLive::TLWinGoo::reg_country(); + if ($foo) { + $::lang = $foo; + } else { + tllog($::LOG_DEBUG, "Didn't get any usuful code from reg_country: $foo...\n"); + } +} else { + # we load POSIX and locale stuff + require POSIX; + import POSIX qw/locale_h/; + # now we try to deduce $::lang + my $loc = setlocale(&POSIX::LC_CTYPE); + my ($lang,$area,$codeset); + if ($loc =~ m/^([^_.]*)(_([^.]*))?(\.([^@]*))?(@.*)?$/) { + $lang = defined($1)?$1:""; + } + $::lang = $lang if ($lang); +} my $mw; |