From 95377e23ad7fdb22ab767a8800c59663b195eff0 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 13 Feb 2012 00:36:11 +0000 Subject: allow area selection in translations git-svn-id: svn://tug.org/texlive/trunk@25377 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLWinGoo.pm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm') diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index b4300ce5180..f49f8df771c 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -253,26 +253,28 @@ Two-letter country code representing the locale of the current user sub reg_country { my $value = $Registry -> {"CUser/Control Panel/International//Locale"}; - return 0 unless $value; + return unless $value; # there might be trailing nulls on Vista $value =~ s/\x00*$//; $value = substr $value, -4; - return 0 unless $value; + return unless $value; my $lmkey = $Registry -> Open("HKEY_CLASSES_ROOT/MIME/Database/Rfc1766/", {Access => KEY_READ()}); - return 0 unless $lmkey; + return unless $lmkey; $lm = $lmkey->{"/$value"}; - return 0 unless $lm; + return unless $lm; debug("found lang codes value = $value, lm = $lm...\n"); if ($lm) { if ($lm =~ m/^zh-(tw|hk)$/i) { - return ("zh-tw"); + return ("zh", "tw"); } elsif ($lm =~ m/^zh/) { # for anything else starting with zh return, that is zh, zh-cn, zh-sg # and maybe something else - return ("zh-cn"); + return ("zh", "cn"); } else { - return(substr $lm, 0, 2); + my $lang = lc(substr $lm, 0, 2); + my $area = lc(substr $lm, 4); + return($lang, $area); } } } -- cgit v1.2.3