summaryrefslogtreecommitdiffstats
path: root/library/msgcat
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-15 16:21:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-02-15 16:21:49 (GMT)
commit9d856256a392f919a13d4dc2171dcbdf4c39e31c (patch)
tree97337ec0e3c74e82873bc50955347f506e115551 /library/msgcat
parent8085eb88ab1525a1b91106d59723e8c3fecdf9f8 (diff)
parent02a26d7bcd80d7c7f7a2733ebecdbfb89d1212c5 (diff)
downloadtcl-9d856256a392f919a13d4dc2171dcbdf4c39e31c.zip
tcl-9d856256a392f919a13d4dc2171dcbdf4c39e31c.tar.gz
tcl-9d856256a392f919a13d4dc2171dcbdf4c39e31c.tar.bz2
merge trunk
Diffstat (limited to 'library/msgcat')
-rw-r--r--library/msgcat/msgcat.tcl15
-rw-r--r--library/msgcat/pkgIndex.tcl2
2 files changed, 7 insertions, 10 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index 5f8e1e9..77e70a5 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -13,7 +13,7 @@
package require Tcl 8.5-
# When the version number changes, be sure to update the pkgIndex.tcl file,
# and the installation directory in the Makefiles.
-package provide msgcat 1.5.0
+package provide msgcat 1.5.1
namespace eval msgcat {
namespace export mc mcload mclocale mcmax mcmset mcpreferences mcset \
@@ -287,7 +287,7 @@ proc msgcat::mcload {langdir} {
}
set x 0
foreach p [mcpreferences] {
- if { $p eq {} } {
+ if {$p eq {}} {
set p ROOT
}
set langfile [file join $langdir $p.msg]
@@ -374,7 +374,7 @@ proc msgcat::mcflset {src {dest ""}} {
# Results:
# Returns the number of pairs processed
-proc msgcat::mcmset {locale pairs } {
+proc msgcat::mcmset {locale pairs} {
variable Msgs
set length [llength $pairs]
@@ -551,10 +551,9 @@ proc msgcat::Init {} {
# Examples: de-CH -> de_ch, sr-Latn-CS -> sr_cs@latin, es-419 -> es
#
set key {HKEY_CURRENT_USER\Control Panel\International}
- if {([registry values $key "LocaleName"] ne "")
+ if {![catch {registry get $key LocaleName} localeName]
&& [regexp {^([a-z]{2,3})(?:-([a-z]{4}))?(?:-([a-z]{2}))?(?:-.+)?$}\
- [string tolower [registry get $key "LocaleName"]] match locale\
- script territory]} {
+ [string tolower $localeName] match locale script territory]} {
if {"" ne $territory} {
append locale _ $territory
}
@@ -562,9 +561,7 @@ proc msgcat::Init {} {
if {[dict exists $modifierDict $script]} {
append locale @ [dict get $modifierDict $script]
}
- if {![catch {
- mclocale [ConvertLocale $locale]
- }]} {
+ if {![catch {mclocale [ConvertLocale $locale]}]} {
return
}
}
diff --git a/library/msgcat/pkgIndex.tcl b/library/msgcat/pkgIndex.tcl
index a5b6499..271265b 100644
--- a/library/msgcat/pkgIndex.tcl
+++ b/library/msgcat/pkgIndex.tcl
@@ -1,2 +1,2 @@
if {![package vsatisfies [package provide Tcl] 8.5-]} {return}
-package ifneeded msgcat 1.5.0 [list source [file join $dir msgcat.tcl]]
+package ifneeded msgcat 1.5.1 [list source [file join $dir msgcat.tcl]]