Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Titles and labels could be translated automatically, when you use <code>Zend_Navigation</code>. Check out <a href="http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.navigation" rel="nofollow">reference guide</a>. Just pick your helper and set <code>Zend_Translate</code> to it. </p> <p><strong>EDIT</strong>: First of all, in code from comment you're doing two things wrong:<br> 1. Using <code>setUseTranslator</code> and passing translator object into it. But <code>setUseTranslator</code> takes boolean value describing to use or not translator. You set translator using <code>setTranslator</code> method:</p> <pre><code>$view-&gt;navigation($navContainer) //RB setUseTranslator is unnecessary, because it's true by deafult -&gt;setTranslator(Zend_Registry::get('TranslationObject')); </code></pre> <p>2. Before use chaining be sure, that method returns object that you want:</p> <pre><code>$view-&gt;navigation($navContainer) -&gt;setAcl($this-&gt;_acl) -&gt;setRole(($this-&gt;_auth-&gt;getStorage()-&gt;read())?$this-&gt;_auth-&gt;getStorage()-&gt;read()-&gt;role:'guest') -&gt;findAllBy('class', 'nav_header'); //that returns an array, not Zend_Navigation object! </code></pre> <p>So you can't do:</p> <pre><code>$navigation-&gt;findAllBy('class', 'nav_header') -&gt;setUseTranslator(Zend_Registry::get('TranslationObject')); //wrong methid here, should be setTranslator, as mentioned above </code></pre> <p>Call <code>setTranslator</code> on <code>$navigation</code> object and it should work. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload