It so happens I wrote an article on my blog about exactly this issue: per module translation sources. I think it can help you out. If you have any questions, you can leave a comment on the article or post them here.
Does anybody know how i can combine zend_translate with a modular directory structure?
First i tried to add the translations directly into the module like so:
default/translations
default/controllers
In my IndexController.php i added:
public function init()
{
$this->_translation = new Zend_Translate(adapter, '../translations', null, array('scan' => Zend_Translate::LOCALE_DIRECTORY));
}
without any luck, then i tried:
translations/en/default/index/index
application/default/presenters/IndexController.php
added to my bootstrap:
$tr = new Zend_Translate(adapter, 'translations', null, array('scan' => 2));
$reg->set('tr', $tr);
and changed my init() to:
public function init()
{
// the registry key is set in my bootstrap
$this->_translation = Zend_Registry::get('tr');
}
but this does not function either.. and i doubt that using translations/en/index/index will work, maybe translations/module/en/index/index?
all help is greatly appreciated
It so happens I wrote an article on my blog about exactly this issue: per module translation sources. I think it can help you out. If you have any questions, you can leave a comment on the article or post them here.