ZF2 Translator view helper no longer works?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

ZF2 Translator view helper no longer works?

cmple
This post has NOT been accepted by the mailing list yet.
Hi,
After updating to the latest version, the translate helper has stopped working.

here is my module config:

'instance' => array(
        'alias' => array(
                'translator' => 'Zend\Translator\Translator',
        ),
        'translator' => array (
                'parameters' => array (
                        'options' => array(
                                'adapter' => 'Gettext',
                                'locale' => 'en',
                                'content' => __DIR__ . '/../translate',
                                'scan' => 'filename'
                        )
                )
        ),
        'Zend\View\Helper\Translator' => array(
                'parameters' => array(
                        'translate' => 'translator'
                ),
        ),
),
'view_manager' => array(
    'display_not_found_reason' => true,
    'display_exceptions'       => true,
    'doctype'                  => 'HTML5',
    'not_found_template'       => 'error/404',
    'exception_template'       => 'error/index',
    'template_map' => array(
        'layout/layout' => __DIR__ . '/../view/layout/layout.phtml',
        'index/index'   => __DIR__ . '/../view/index/index.phtml',
        'error/404'     => __DIR__ . '/../view/error/404.phtml',
        'error/index'   => __DIR__ . '/../view/error/index.phtml',
    ),
   
    'template_path_stack' => array(
        'Application' => __DIR__ . '/../view',
    ),
   
    'strategies' => array(
        'ViewJsonStrategy',
    ),
   
    'helper_map' => array(
        '_' => 'Zend\View\Helper\Translator'
    ),
),


view/application/index.phtml:
<?php echo $this->_('Gettext String'); ?>

This worked before the update, Am I missing something?
Any help would be really appreciated

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 Translator view helper no longer works?

HHGAG
This post has NOT been accepted by the mailing list yet.
Reply | Threaded
Open this post in threaded view
|

Re: ZF2 Translator view helper no longer works?

cmple
This post has NOT been accepted by the mailing list yet.
Thanks HHGAG! That helped!