Tcl Source Code

View Ticket
Login
Ticket UUID: 3565279
Title: Dynamic Locale Change for msgcat with on-demand File Load
Type: RFE Version: None
Submitter: oehhar Created on: 2012-09-06 13:22:49
Subsystem: 30. msgcat Package Assigned To: oehhar
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2015-10-21 16:38:13
Resolution: Accepted Closed By: oehhar
    Closed on: 2015-10-21 16:38:13
Description:
Feature request 3511941 / TIP#399 "Add msgcat dynamic languages ability" were not able to reload any registered message files.

Using this version, message files are loaded if required by a locale change:

% msgcat::mclocale en
en
% namespace eval p1 { msgcat::mcload msgs }
... will load message files en.msg and ROOT.msg from folder msgs
...
% msgcat::mclocale fr
...will load fr.msg from folder msgs and locale will be available

A package may inform itself about locale change:

% namespace eval p1 {msgcat::mcpackageconfig changecmd updateGUI}
% msgcat::mclocale de
...will load de.msg from folder msgs and locale will be available
...will invoke "::pi::updateGUI de {}"

The attached file is the first implementation. It contains tip404.
Also attached is a prepared tip for review.

Thank you all,
Harald
User Comments: oehhar added on 2015-10-21 16:38:13:

Accepted as TIP 412. Implemented in branch [msgcat_dyn_locale] and merged to trunk with [392ff6199d].


oehhar added on 2012-09-06 20:24:06:

File Added - 452685: 399BIS_tip.txt

oehhar added on 2012-09-06 20:22:50:

File Added - 452684: msgcat.tcl

Attachments: