summaryrefslogtreecommitdiffstats
path: root/library/msgcat/msgcat.tcl
diff options
context:
space:
mode:
authornijtmans@users.sourceforge.net <jan.nijtmans>2012-06-28 19:59:10 (GMT)
committernijtmans@users.sourceforge.net <jan.nijtmans>2012-06-28 19:59:10 (GMT)
commit3ae62dec90a0df3f4ca0aa3b3cf9f86f022dcf4e (patch)
treec177b306cc7eabdede0019b7baa94421273e2a89 /library/msgcat/msgcat.tcl
parent520694a58080e97c074cad03586259c67bcd2a25 (diff)
parentdca8e0445683dc4e2ffd2e04dff00dfc7fded3e0 (diff)
downloadtcl-3ae62dec90a0df3f4ca0aa3b3cf9f86f022dcf4e.zip
tcl-3ae62dec90a0df3f4ca0aa3b3cf9f86f022dcf4e.tar.gz
tcl-3ae62dec90a0df3f4ca0aa3b3cf9f86f022dcf4e.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