summaryrefslogtreecommitdiffstats
path: root/library/msgcat
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)
commite53523e7b878272b5562743d35dfd83cc3c80500 (patch)
treec177b306cc7eabdede0019b7baa94421273e2a89 /library/msgcat
parent93a473b9ee7e8c4bf201f503714515b25984b7ef (diff)
parent024c0f6699f2ffffd1ac1d5e82c7c9d861deb9c7 (diff)
downloadtcl-e53523e7b878272b5562743d35dfd83cc3c80500.zip
tcl-e53523e7b878272b5562743d35dfd83cc3c80500.tar.gz
tcl-e53523e7b878272b5562743d35dfd83cc3c80500.tar.bz2
merge trunk
bug fix: variable $key not found make it work on cygwin as well
Diffstat (limited to 'library/msgcat')
-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