Note that there are some explanatory texts on larger screens.

plurals
  1. POZend Framework menu translation
    text
    copied!<p>I am developing an multilingual web application.I have menu elemnts which came from xml file but i dont know how to translate menu.On the other hand,I could translate normal content of site in the view like this:</p> <pre><code>&lt;?=$this-&gt;translate-&gt;_('Members Login') </code></pre> <p>My bootstrap file:</p> <pre><code> class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { private $_acl = null; private $_auth = null; protected function _initAutoLoad() { $modelLoader = new Zend_Application_Module_Autoloader(array( 'namespace' =&gt; '', 'basePath' =&gt; APPLICATION_PATH )); if (Zend_Auth::getInstance()-&gt;hasIdentity()) { Zend_Registry::set('role', Zend_Auth::getInstance()-&gt;getStorage()-&gt;read()-&gt;role); } else { Zend_Registry::set('role', 'guest'); } $this-&gt;_acl = new Model_LibraryAcl(); $this-&gt;_auth = Zend_Auth::getInstance(); $fc = Zend_Controller_Front::getInstance(); $fc-&gt;registerPlugin(new Plugin_AccessCheck($this-&gt;_acl, $this-&gt;_auth)); return $modelLoader; } function _initViewHelpers() { $this-&gt;bootstrap('layout'); $layout = $this-&gt;getResource('layout'); $view = $layout-&gt;getView(); $view-&gt;doctype('HTML4_STRICT'); $view-&gt;headMeta()-&gt;appendHttpEquiv('Content-type','text/html;charset=UTF-8') -&gt;appendName('description','The Best Freelance Projects'); $view-&gt;headTitle('Freelance Duty'); $navContainerConfig = new Zend_Config_Xml(APPLICATION_PATH.'/configs/navigation.xml','nav'); $navContainer = new Zend_Navigation($navContainerConfig); $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'); } function _initSetTranslations() { $this-&gt;bootstrap('layout'); $layout = $this-&gt;getResource('layout'); $view = $layout-&gt;getView(); $translate = new Zend_Translate('gettext',APPLICATION_PATH.'/languages/tr.mo','tr'); $translate-&gt;setLocale('tr'); $view-&gt;translate = $translate; Zend_Registry::set('TranslationObject', $translate); } } </code></pre> <p>and write the menu in view like this:</p> <pre><code>echo $this-&gt;navigation()-&gt;menu()-&gt;setUlClass('nav_header'); </code></pre> <p>i dont know howto translate menu Any comments?</p> <p>Thanks in advance</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