Hi,
I think, it's good to use bootstrap initialization and Zend_Registry in this
case, and then use
http://framework.zend.com/manual/en/zend.view.helpers.html#zend.view.helpers.initial.translate
translate view helper
// bootstrap
$adapter = new Zend_Translate('csv', LANG_EN);
Zend_Registry::set('Zend_Translate', $adapter);
// and in the view
echo $this->translate('hello');
Regards
Martin H.
Mauricio Cuenca wrote:
>
> Hello,
>
> I am implementing Zend_Translate in an application, but right now, I have
> initialize the object in each controller using the init() method. Is it
> possible to create a Zend_Translate object to be available in all the
> views?
>
> Should I create a instance of it in the bootstrap file? What would be the
> simplest approach?
>
> I have something like this in each init():
>
> $translate = new Zend_Translate('csv', LANG_EN);
> $this->view->translate = $translate;
>
> Thanks
>
--
View this message in context:
http://www.nabble.com/Zend_Translator-global-availabilty-tp15831648s16154p15832367.html
Sent from the Zend Framework mailing list archive at Nabble.com.