summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-02-13 00:36:11 +0000
committerNorbert Preining <preining@logic.at>2012-02-13 00:36:11 +0000
commit95377e23ad7fdb22ab767a8800c59663b195eff0 (patch)
treeecd8adb65cfc5ab7b1f22a46f52d1c7844b569fe /Master/tlpkg/TeXLive/TLWinGoo.pm
parent07e1924e1f6dce1a28ea1f53358946d87e9ba46b (diff)
allow area selection in translations
git-svn-id: svn://tug.org/texlive/trunk@25377 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm16
1 files changed, 9 insertions, 7 deletions
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);
}
}
}