ZF-7941: Allow to instanciate Zend_Tranlate without file/directory


It could be pratical to be able to instanciate a Zend_Translate object without having to specify a filename or directory. For the moment, the first way I find is to pass into parameters a file without content.

Example of use : instanciate Zend_Translate in its own resource plugin (to configure it : type of file, language, ...)., but populate it later, in an other class, which does not matter with Zend_Translate configuration.


Why don't you then also instantiate it in an other class?

To benefit from resource plugin functionalities . This resource plugin does this work and my other class (another resource plugin specific to modular functionalities) add translation file, if needed, to the current Zend_Translate instance (stored in bootstrap registry). Bad approach ?

So you have no basic module or translation when no module is attached at all ? Bad approach ? :-)

eheh ! My resource plugin takes into account each module functionnalities, among them the application core. So this class is always called, with or without module attached (at all). All languages files are located in the same directory (not in /modules/), then the class parses 'default' module and others (which are detected as activated (in DB)). By loading translation files in resource plugin just for the core ("default" module), I would need to not take into account these files when I will load the rest (files linked to other modules), whereas it's simpler to load all of them in the same time, without having two processes in two classes (with three levels of tree structure of each file (translation overloading system) I would have to externalize the process elsewhere if it is shared) (sorry if my english is not impressive)

Added with r18410 Warnings have to be switched off explicitly.