zend-frameworkzend-framework2zend-translate

Issue in Zend Translation


There was issue with the msgid and msgstr in zend translation

define - en_US.PO

msgid "hello"

msgstr "hello world"

View/index.phtml

$this->translate("hello");

I would like to show "hello world" when I am trying to using msgid "hello" then it shows me "hello" instead of "hello world".

Please help me out what I have to do for that?


Solution

  • Check your module.config.php file

    ),
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),