Ah, menu partial

<ul class="navigation ui-helper-clearfix">
<? $i = 0; foreach ($this->container as $page) : ?>
 <li class="ui-widget-header<? if (0 == $i++) : ?> ui-corner-left<? elseif
($this->container->count() == $i) : ?> ui-corner-right<? endif; ?>">
 <a title="<?= $page->getTitle() ?>" href="<?= $page->getHref() ?>"><?=
$page->getLabel() ?></a>
 </li>
<? endforeach; ?>
</ul>

I don't know what is the best practice in such case.

I use 2 Zend_Translate objects, one with array and one with gettext adapter.
The one with gettext adapter is for view scritps, and I use poedit to parse
views and auto generate po files. Other array adapter I use for forms and
validation messages, and now I wanted to add navigation.

Should I get it from navigation, so my partial looks like

<ul class="navigation ui-helper-clearfix">
<? $i = 0; foreach ($this->container as $page) : ?>
 <li class="ui-widget-header<? if (0 == $i++) : ?> ui-corner-left<? elseif
($this->container->count() == $i) : ?> ui-corner-right<? endif; ?>">
 <a title="<?=
$this->navigation()->getTranslator()->translate($page->getTitle()) ?>"
href="<?= $page->getHref() ?>"><?=
$this->navigation()->getTranslator()->translate($page->getLabel()) ?></a>
 </li>
<? endforeach; ?>
</ul>

or you have some better idea?

Regards,
Saša Stamenković


On Thu, Jun 10, 2010 at 10:54 AM, umpirsky <[email protected]> wrote:

>
> In the layout, dumping
>
> <?  Zend_Debug::dump($this->navigation()->getUseTranslator());  ?>
> <?  Zend_Debug::dump($this->navigation()->getTranslator()); exit; ?>
> <?= $this->navigation()->menu()->setPartial('partials/menu.phtml') ?>
>
> gives correct translator and true for useTranslator.
> --
> View this message in context:
> http://zend-framework-community.634137.n4.nabble.com/Translating-navigation-tp2250120p2250125.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>

Reply via email to