summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2013-02-14 11:09:31 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2013-02-14 11:09:31 (GMT)
commit2ba17918f72d6f2f0042928facbc0563a52c3b54 (patch)
treed11299617ed9729372d73f8eb79fb81583dcf2bf /library
parente88c4704a6e5b1de286572acb8827f466f20c25c (diff)
downloadtcl-2ba17918f72d6f2f0042928facbc0563a52c3b54.zip
tcl-2ba17918f72d6f2f0042928facbc0563a52c3b54.tar.gz
tcl-2ba17918f72d6f2f0042928facbc0563a52c3b54.tar.bz2
Finer granulated catchbug_3604576
Diffstat (limited to 'library')
-rw-r--r--library/msgcat/msgcat.tcl30
1 files changed, 13 insertions, 17 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index fbb9730..97ad4fa 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -550,24 +550,20 @@ proc msgcat::Init {} {
# Those are translated to local strings.
# Examples: de-CH -> de_ch, sr-Latn-CS -> sr_cs@latin, es-419 -> es
#
- if {[catch {
- 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\
- script territory]} {
- if {"" ne $territory} {
- append locale _ $territory
- }
- set modifierDict [dict create latn latin cyrl cyrillic]
- if {[dict exists $modifierDict $script]} {
- append locale @ [dict get $modifierDict $script]
- }
- mclocale [ConvertLocale $locale]
+ set key {HKEY_CURRENT_USER\Control Panel\International}
+ if { ![catch {registry get $key "LocaleName"} localeName]
+ && [regexp {^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}))?(?:-.+)?$}\
+ [string tolower $localeName] match locale script territory]} {
+ if {"" ne $territory} {
+ append locale _ $territory
+ }
+ set modifierDict [dict create latn latin cyrl cyrillic]
+ if {[dict exists $modifierDict $script]} {
+ append locale @ [dict get $modifierDict $script]
+ }
+ if {![catch { mclocale [ConvertLocale $locale] }]} {
+ return
}
- }]} {
- mclocale C
- return
}
# then check key locale which contains a numerical language ID