summaryrefslogtreecommitdiffstats
path: root/library/clock.tcl
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2015-10-21 20:30:49 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2015-10-21 20:30:49 (GMT)
commit775b09cb001aae11f753654ae22365f295f56fe8 (patch)
tree61321e385f5621c45da01310ff5433686734214c /library/clock.tcl
parent0a228666ae8b3189ae92ff7624263de1455c24ff (diff)
downloadtcl-775b09cb001aae11f753654ae22365f295f56fe8.zip
tcl-775b09cb001aae11f753654ae22365f295f56fe8.tar.gz
tcl-775b09cb001aae11f753654ae22365f295f56fe8.tar.bz2
Change "clock format -format %x -locale current" output on msgcat locale change [4a0c163d24]
Diffstat (limited to 'library/clock.tcl')
-rwxr-xr-xlibrary/clock.tcl36
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]