Balcanizing WMessageResourceBundle
Added by Garrett Mc over 12 years ago
Does anybody have a recommended way to split out a WMessageResourceBundle into a library? I'm working on a system that pulls a number of tools in as plugins. I would like these plugins to carry their own resource bundles instead of using the central one (essentially they have to do this, it's a plugin based ipsum generator). However all the examples seem to import into the applications central bundle instead of just having their own object with it's own handle.
Ideally, since these are essentially factory classes I'd like to have a local WT::WMessageResourceBundle _textBundle held as a private object of factory so when it gets requests for text it can peer into it's resource bundle and return a WString or WText depending on what it requested.
My end goal is not to build an ipsum generator but this is allowing me to resolve some big questions on a different project, I've got the basic plugins working and returning WString and WText objects on request but it's hard coded data until I resolve this bundle issue either dropping resource bundle or by making a local bundle solution.
Replies (2)
RE: Balcanizing WMessageResourceBundle - Added by Wim Dumon over 12 years ago
Hello,
Translation resources are application global. If we want to work in a modular fashion, we tend to prefix the keys with something related to the classes, e.g. tr("customer-entry-form.customername").
BR,
wim.
RE: Balcanizing WMessageResourceBundle - Added by Garrett Mc over 12 years ago
OK, so it sounds like I'm trying to re-purpose something that's a bit too special purpose for my needs. I guess I'll go with a csv or line separated data set and just read it in on object creation. As a translation resource this is still useful but is it possible to register different files for different scopes within an application?