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

Issue Type: New Feature Created: 2009-09-24T01:32:15.000+0000 Last Updated: 2009-09-25T06:37:40.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Marc Thomas (existenz) Assignee: Thomas Weidner (thomas) Tags: - Zend_Translate

Related issues: Attachments:


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.


Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-09-24T17:19:45.000+0000

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

Posted by Marc Thomas (existenz) on 2009-09-24T23:57:49.000+0000

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 ?

Posted by Thomas Weidner (thomas) on 2009-09-25T00:28:03.000+0000

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

Posted by Marc Thomas (existenz) on 2009-09-25T00:53:45.000+0000

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)

Posted by Thomas Weidner (thomas) on 2009-09-25T06:37:36.000+0000

Added with r18410 Warnings have to be switched off explicitly.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.