ZF-7352: Resource_Translate should test registry
Description
Line 78 in Zend/Application/Resource/Translate.php
If I want to use this resource with a module bootstrap
I must set a registry-key or it will overwrite any other translate object, which is registered there, even if I just want to use it straight from the module bootstrap.
$bootstrap = $this->getModuleBootstrap(); // A shortcut I wrote
$translate = $bootstrap->getPluginResource('translate')->getTranslate();
So it should test the registry before
if (!Zend_Registry::has ($key)) {
Zend_Registry::set($key, $this->_translate);
}
Comments
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-09-26T15:55:57.000+0000
If I understand correctly; you're trying to bootstrap the translation resource twice, but want the second time ignored?
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-09-27T13:41:31.000+0000
Closing as won't fix because it doesn't make any sense to bootstrap the same Resource Plugin twice.
If you feel your issue was misunderstood please comment and reopen.
Posted by Sebastian Krebs (kingcrunch) on 2009-09-27T14:06:07.000+0000
I wanted to use the translate-plugin within module bootstraps also, but depending on the order they are executed, one will overwrite the other. As you can see this report is from July, so I dont know exactly, what I wanted to do that time. Now I would say, that it may be useful, if a second call will just add other language files to the object from the registry, instead of overwriting the it. Just as a suggestion :) This will allow users to add additional module based language files.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-09-27T14:30:11.000+0000
Issue reopened. Will evaluate later.
Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-10-16T11:05:19.000+0000
Fixed. Thank you for reporting the issue!