summaryrefslogtreecommitdiffstats
path: root/library/msgcat/msgcat.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-28 19:59:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-06-28 19:59:10 (GMT)
commiteca033cfb854b6950a21b858085a58d0f9002860 (patch)
treec177b306cc7eabdede0019b7baa94421273e2a89 /library/msgcat/msgcat.tcl
parenta9f64ab24b5965c3bf6f65e0de8b8706fc38ec7c (diff)
parent3275986a1aad85bc313bd0c5ce901b5124dc61de (diff)
downloadtcl-eca033cfb854b6950a21b858085a58d0f9002860.zip
tcl-eca033cfb854b6950a21b858085a58d0f9002860.tar.gz
tcl-eca033cfb854b6950a21b858085a58d0f9002860.tar.bz2
merge trunk
bug fix: variable $key not found make it work on cygwin as well
Diffstat (limited to 'library/msgcat/msgcat.tcl')
-rw-r--r--library/msgcat/msgcat.tcl8
1 files changed, 4 insertions, 4 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index 0b12dea..204de9c 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -32,7 +32,7 @@ namespace eval msgcat {
variable Msgs [dict create]
# Map of language codes used in Windows registry to those of ISO-639
- if { $::tcl_platform(platform) eq "windows" } {
+ if {[info sharedlibextension] eq ".dll"} {
variable WinRegToISO639 [dict create {*}{
01 ar 0401 ar_SA 0801 ar_IQ 0c01 ar_EG 1001 ar_LY 1401 ar_DZ
1801 ar_MA 1c01 ar_TN 2001 ar_OM 2401 ar_YE 2801 ar_SY
@@ -426,7 +426,7 @@ proc msgcat::ConvertLocale {value} {
# Initialize the default locale
proc msgcat::Init {} {
- global env tcl_platform
+ global env
#
# set default locale, try to get from environment
@@ -454,7 +454,7 @@ proc msgcat::Init {} {
# The rest of this routine is special processing for Windows;
# all other platforms, get out now.
#
- if {$tcl_platform(platform) ne "windows"} {
+ if {[info sharedlibextension] ne ".dll"} {
mclocale C
return
}
@@ -478,6 +478,7 @@ proc msgcat::Init {} {
# Those are translated to local strings.
# Examples: de-CH -> de_ch, sr-Latn-CS -> sr_cs, es-419 -> es
#
+ set key {HKEY_CURRENT_USER\Control Panel\International}
if {([registry values $key "LocaleName"] ne "")
&& [regexp {^([a-z]{2,3})(?:-[a-z]{4})?(?:-([a-z]{2}))?(?:-.+)?$}\
[string tolower [registry get $key "LocaleName"]] match locale\
@@ -494,7 +495,6 @@ proc msgcat::Init {} {
# then check key locale which contains a numerical language ID
if {[catch {
- set key {HKEY_CURRENT_USER\Control Panel\International}
set locale [registry get $key "locale"]
}]} {
mclocale C