diff options
author | oehhar <harald.oehlmann@elmicron.de> | 2024-03-04 11:00:06 (GMT) |
---|---|---|
committer | oehhar <harald.oehlmann@elmicron.de> | 2024-03-04 11:00:06 (GMT) |
commit | 07323b0f298a362c79e61a8b5984b0d9862e534e (patch) | |
tree | cf2dd2d5fd60bfe3adbcf38e78f3e68c0c9b1b4b /library | |
parent | e519681e7dae6918c1f7ea5ef9865bb647804d62 (diff) | |
parent | 423d8bf1e34f5281814b35f98870ad998d807b3e (diff) | |
download | tcl-07323b0f298a362c79e61a8b5984b0d9862e534e.zip tcl-07323b0f298a362c79e61a8b5984b0d9862e534e.tar.gz tcl-07323b0f298a362c79e61a8b5984b0d9862e534e.tar.bz2 |
Merge current main branch
Diffstat (limited to 'library')
-rw-r--r-- | library/clock.tcl | 13 | ||||
-rw-r--r-- | library/msgcat/msgcat.tcl | 45 |
2 files changed, 36 insertions, 22 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index 1891b21..60dfb38 100644 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -16,9 +16,17 @@ # #---------------------------------------------------------------------- -# We must have message catalogs that support the root locale. +# msgcat 1.7 features are used. We need access to the Registry on Windows +# systems. -package require msgcat 1.6 +uplevel \#0 { + package require msgcat 1.7 + if { $::tcl_platform(platform) eq {windows} } { + if { [catch { package require registry 1.1 }] } { + namespace eval ::tcl::clock [list variable NoRegistry {}] + } + } +} # Put the library directory into the namespace for the ensemble so that the # library code can find message catalogs and time zone definition files. @@ -52,6 +60,7 @@ namespace eval ::tcl::clock { # Import the message catalog commands that we use. namespace import ::msgcat::mclocale + proc mc {args} { tailcall ::msgcat::mcn [namespace current] {*}$args } namespace import ::msgcat::mcpackagelocale } diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index fa21685..f6e5224 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -1220,27 +1220,32 @@ proc msgcat::mcutil::ConvertLocale {value} { # - called from an class defined oo object # - called from a classless oo object proc ::msgcat::PackageNamespaceGet {} { - uplevel 2 { - # Check self namespace to determine environment - switch -exact -- [namespace which self] { - {::oo::define::self} { - # We are within a class definition - return [namespace qualifiers [self]] - } - {::oo::Helpers::self} { - # We are within an object - set Class [info object class [self]] - # Check for classless defined object - if {$Class eq {::oo::object}} { - return [namespace qualifiers [self]] - } - # Class defined object - return [namespace qualifiers $Class] - } - default { - # Not in object environment - return [namespace current] + set ns [uplevel 2 { namespace current }] + + if {![string match {::oo::*} $ns]} { + # Not in object environment + return $ns + } + + # Check self namespace to determine environment + switch -exact -- [uplevel 2 { namespace which -command self }] { + {::oo::define::self} { + # We are within a class definition + return [namespace qualifiers [uplevel 2 { self }]] + } + {::oo::Helpers::self} { + # We are within an object + set Class [info object class [uplevel 2 { self }]] + # Check for classless defined object + if {$Class eq {::oo::object}} { + return [namespace qualifiers [uplevel 2 { self }]] } + # Class defined object + return [namespace qualifiers $Class] + } + default { + # Not in object environment + return $ns } } } |