summaryrefslogtreecommitdiffstats
path: root/library/msgcat/msgcat.tcl
diff options
context:
space:
mode:
authoroehhar <harald.oehlmann@elmicron.de>2012-09-07 15:32:15 (GMT)
committeroehhar <harald.oehlmann@elmicron.de>2012-09-07 15:32:15 (GMT)
commitec48c37cfcfbbd45233696741ce5c7b44b8e43bf (patch)
tree2f6f043866e7af65c844fc0ccbc7cc4f63458e90 /library/msgcat/msgcat.tcl
parent43f16074cb838b5bb19f3504fc9e6c66458fbdf9 (diff)
downloadtcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.zip
tcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.tar.gz
tcl-ec48c37cfcfbbd45233696741ce5c7b44b8e43bf.tar.bz2
Reentrant mcfl(m)set command, test, document mcflset as recommended for message files
Diffstat (limited to 'library/msgcat/msgcat.tcl')
-rw-r--r--library/msgcat/msgcat.tcl12
1 files changed, 8 insertions, 4 deletions
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index 6dd44d2..112507a 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -25,10 +25,7 @@ namespace eval msgcat {
# Records the list of locales to search
variable Loclist {}
- # Records the locale of the currently sourced message catalogue file; this
- # would be problematic if anyone were to recursively load a message
- # catalog for a different locale from inside a catalog, but that's not a
- # case that we really need to worry about.
+ # Records the locale of the currently sourced message catalogue file
variable FileLocale
# Records the mapping between source strings and translated strings. The
@@ -284,6 +281,10 @@ proc msgcat::mcpreferences {} {
proc msgcat::mcload {langdir} {
variable FileLocale
+ # Save the file locale if we are recursively called
+ if {[info exists FileLocale]} {
+ set nestedFileLocale $FileLocale
+ }
set x 0
foreach p [mcpreferences] {
if { $p eq {} } {
@@ -300,6 +301,9 @@ proc msgcat::mcload {langdir} {
unset FileLocale
}
}
+ if {[info exists nestedFileLocale]} {
+ set FileLocale $nestedFileLocale
+ }
return $x
}