diff options
Diffstat (limited to 'library')
-rwxr-xr-x | library/clock.tcl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/library/clock.tcl b/library/clock.tcl index bfdf832..8e4b657 100755 --- a/library/clock.tcl +++ b/library/clock.tcl @@ -111,6 +111,7 @@ proc ::tcl::clock::Initialize {} { mcpackagelocale set {} ::msgcat::mcpackageconfig set mcfolder [file join $LibDir msgs] ::msgcat::mcpackageconfig set unknowncmd "" + ::msgcat::mcpackageconfig set changecmd ChangeCurrentLocale # Define the message catalog for the root locale. @@ -4475,6 +4476,41 @@ proc ::tcl::clock::AddDays { days clockval timezone changeover } { #---------------------------------------------------------------------- # +# ChangeCurrentLocale -- +# +# The global locale was changed within msgcat. +# Clears the buffered parse functions of the current locale. +# +# Parameters: +# loclist (ignored) +# +# Results: +# None. +# +# Side effects: +# Buffered parse functions are cleared. +# +#---------------------------------------------------------------------- + +proc ::tcl::clock::ChangeCurrentLocale {args} { + variable FormatProc + variable LocaleNumeralCache + variable CachedSystemTimeZone + variable TimeZoneBad + + foreach p [info procs [namespace current]::scanproc'*'current] { + rename $p {} + } + foreach p [info procs [namespace current]::formatproc'*'current] { + rename $p {} + } + + catch {array unset FormatProc *'current} + set LocaleNumeralCache {} +} + +#---------------------------------------------------------------------- +# # ClearCaches -- # # Clears all caches to reclaim the memory used in [clock] |