From e3f16b8dc7d1d604b5ef0d1e205cd70e406026b6 Mon Sep 17 00:00:00 2001 From: oehhar Date: Wed, 19 Sep 2012 20:40:14 +0000 Subject: (proposal) msgcat with dynamic mc file load on locale change --- ChangeLog | 8 +- changes | 2 +- library/msgcat/msgcat.tcl | 723 +++++++++++++++++++++++++++++++++++++++------- 3 files changed, 623 insertions(+), 110 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ba37af..9920962 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,11 +1,7 @@ 2012-09-19 Harald Oehlmann - IMPLEMENTATION OF TIP#399. - - * library/msgcat/msgcat.tcl: [FRQ 3544988]: New commands [mcconfig] - * library/msgcat/pkgIndex.tcl: to set additional mcload search pattern. - * unix/Makefile.in: Bump to 1.6.0. - * win/Makefile.in: + * library/msgcat/msgcat.tcl: dynamic locale change with mc file + load on locale change. 2012-09-19 Jan Nijtmans diff --git a/changes b/changes index f4c501d..b6cacf5 100644 --- a/changes +++ b/changes @@ -8117,4 +8117,4 @@ Dropped support for OS X versions less than 10.4 (Tiger) (fellows) --- Released 8.6b3, September 18, 2012 --- See ChangeLog for details --- -2012-09-19 (TIP399) New msgcat command [mcconfig] (oehlmann) +2012-09-19 (feature proposal) msgcat dynamic locale change (oehlmann) diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl index 42c8f20..c35803f 100644 --- a/library/msgcat/msgcat.tcl +++ b/library/msgcat/msgcat.tcl @@ -16,23 +16,28 @@ package require Tcl 8.5 package provide msgcat 1.6.0 namespace eval msgcat { - namespace export mc mcload mclocale mcmax mcmset mcpreferences mcset \ - mcunknown mcflset mcflmset mcconfig - - # Records the current locale as passed to mclocale - variable Locale "" + namespace export mc mcexists mcload mclocale mcmax mcmset\ + mcpreferences mcset mcunknown mcflset mcflmset\ + mcloadedlocales mcforgetpackage\ + mcpackageconfig mcpackagelocale # Records the list of locales to search variable Loclist {} + # List of currently loaded locales + variable LoadedLocales {} + # Records the locale of the currently sourced message catalogue file variable FileLocale - # List of file pattern to load in addition to Loclist. - variable Patternlist {} + # Configuration values per Package (e.g. client namespace). + # The dict key is of the form "