I have a problem with that component. My configuration in Application/config/module.config.php in di->instance section:
'alias' => array (
'translateAdapter' => 'Zend\Translator\Adapter\Gettext',
'viewHelper' => 'Zend\View\Helper\Translator'
),
'translateAdapter' => array (
'parameters' => array (
'locale' => 'de',
'content' => '/home/alex/web/www/sob.lan/www/data/langs',
'scan' => 'filename',
'disableNotices' => true
)
),
'viewHelper' => array(
'parameters' => array(
'translator' => 'translateAdapter'
)
),
After, calling $this->translator()->translate() in view helper function I receive unconfigured gettext adapter.
What is the problem?
The configuration parameters passed to the adapter are called $options in the constructor.
So you should get the desired result as follows:
'translateAdapter' => array (
'parameters' => array (
'options' => array(
'locale' => 'de',
'content' => '/home/alex/web/www/sob.lan/www/data/langs',
'scan' => 'filename',
'disableNotices' => true
)
)
),