Issues

ZF-7352: Resource_Translate should test registry

Issue Type: Improvement Created: 2009-07-22T08:23:12.000+0000 Last Updated: 2009-10-16T11:05:20.000+0000 Status: Resolved Fix version(s): - 1.10.0 (27/Jan/10)

Reporter: Sebastian Krebs (kingcrunch) Assignee: Dolf Schimmel (Freeaqingme) (freak) Tags: - Zend_Application

Related issues: Attachments:

Description

Line 78 in Zend/Application/Resource/Translate.php

<pre class="highlight">
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.

<pre class="highlight">$bootstrap = $this->getModuleBootstrap(); // A shortcut I wrote
$translate = $bootstrap->getPluginResource('translate')->getTranslate();

So it should test the registry before

<pre class="highlight">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!

Have you found an issue?

See the Overview section for more details.

Copyright

© 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.

Contacts