Bug/merging translator textdomains #3948

Closed
wants to merge 3 commits into
from

Projects

None yet

3 participants

@DASPRiD
Member
DASPRiD commented Mar 4, 2013

No description provided.

@weierophinney weierophinney was assigned Mar 8, 2013
@weierophinney weierophinney added a commit that referenced this pull request Mar 11, 2013
@weierophinney weierophinney Merge branch 'hotfix/3948' into develop
Forward port #3948
cf8e335
@weierophinney weierophinney added a commit that closed this pull request Mar 11, 2013
@weierophinney weierophinney Merge branch 'hotfix/3948'
Close #3948
10faee1
@texdc
Contributor
texdc commented Mar 14, 2013

No translator defined:

Zend\I18n\Exception\RuntimeException: Translator has not been set in .../vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Translate.php on line 32
1 0.0005 638472 {main}( ) ../index.php:0
2 0.1057 12979144 Zend\Mvc\Application->run( ) ../index.php:15
3 0.2009 23169288 Zend\Mvc\Application->completeRequest( ) ../Application.php:307
4 0.2009 23169368 Zend\EventManager\EventManager->trigger( ) ../Application.php:332
5 0.2009 23169584 Zend\EventManager\EventManager->triggerListeners( ) ../EventManager.php:204
6 0.2011 23177024 call_user_func ( ) ../EventManager.php:460
7 0.2011 23177056 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( ) ../EventManager.php:460
8 0.3385 30334512 Zend\EventManager\EventManager->trigger( ) ../DefaultRenderingStrategy.php:136
9 0.3385 30334728 Zend\EventManager\EventManager->triggerListeners( ) ../EventManager.php:204
10 0.3388 30344304 call_user_func ( ) ../EventManager.php:460
11 0.3388 30344336 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( ) ../EventManager.php:460

Ok, so I'll define a translator:

'factories' => array(
        'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory'
)

Which results in:

Notice: Undefined index: en_US in .../vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php on line 402
1 0.0003 638472 {main}( ) ../index.php:0
2 0.1069 12979832 Zend\Mvc\Application->run( ) ../index.php:15
3 0.2405 23170104 Zend\Mvc\Application->completeRequest( ) ../Application.php:307
4 0.2406 23170184 Zend\EventManager\EventManager->trigger( ) ../Application.php:332
5 0.2406 23170400 Zend\EventManager\EventManager->triggerListeners( ) ../EventManager.php:204
6 0.2407 23177840 call_user_func ( ) ../EventManager.php:460
7 0.2407 23177872 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( ) ../EventManager.php:460
8 0.3990 30536736 Zend\EventManager\EventManager->trigger( ) ../DefaultRenderingStrategy.php:136
9 0.3990 30536952 Zend\EventManager\EventManager->triggerListeners( ) ../EventManager.php:204
10 0.3993 30546528 call_user_func ( ) ../EventManager.php:460
11 0.3993 30546560 Zend\Mvc\View\Http\DefaultRenderingStrategy->render( ) ../EventManager.php:460
12 0.3993 30546560 Zend\View\View->render( ) ../DefaultRenderingStrategy.php:126
13 0.4066 30622584 Zend\View\Renderer\PhpRenderer->render( ) ../View.php:201
14 0.4071 30767536 include( '.../module/Application/view/layout/application.phtml' ) ../PhpRenderer.php:507
15 0.4095 31069288 Zend\View\Helper\Placeholder\Container\AbstractStandalone->__toString( ) ../PhpRenderer.php:7
16 0.4095 31069288 Zend\View\Helper\HeadTitle->toString( ) ../AbstractStandalone.php:275
17 0.4096 31070136 Zend\I18n\Translator\Translator->translate( ) ../HeadTitle.php:136
18 0.4096 31070216 Zend\I18n\Translator\Translator->getTranslatedMessage( ) ../Translator.php:316

This is a lose-lose situation.

@weierophinney
Member

@texdc Please open a new issue, fully describing the problem you're encountering. Attaching it to an already merged PR is bad practice.

@weierophinney weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge pull request zendframework/zendframework#3948 from DASPRiD/bug/…
…merging-translator-textdomains

Bug/merging translator textdomains
838a14a
@weierophinney weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/3948' b0a3dd4
@weierophinney weierophinney added a commit to zendframework/zend-i18n that referenced this pull request May 15, 2015
@weierophinney weierophinney Merge branch 'hotfix/3948' into develop ee0f255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment