toxygene / rend

Automatically exported from code.google.com/p/rend
Other
0 stars 0 forks source link

Changing the locale does not affect the translator #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Changing the locale in the locale action helper has no affect on the locale
stored in the translation object in the view.

{{{
Zend_Controller_Action_HelperBroker::getStaticHelper('locale')
                                   ->direct()
                                   ->setLanguage('en')
                                   ->setLocale('US');

$view = Zend_Controller_Action_HelperBroker::getStaticHelper('view')
                                           ->direct();

Zend_Controller_Action_HelperBroker::getStaticHelper('locale')
                                   ->direct()
                                   ->setLanguage('fr')
                                   ->setLocale('FR');

echo $view->getHelper('translate')->getLocale(); // en_US
}}}

Original issue reported on code.google.com by justin.h...@gmail.com on 23 May 2008 at 3:59

GoogleCodeExporter commented 9 years ago
Zend_Translate does not maintain a reference to the locale that is assigned to 
it, so
additionally logic needs to be added so things that depend on the locale update
themselves properly.

Original comment by justin.h...@gmail.com on 23 May 2008 at 4:01

GoogleCodeExporter commented 9 years ago
I've made the locale helper a subject and the translator helper an observer and
hooked them together. Updates to the locale will now notify the translator of 
the
change, which will update itself propertly.

Original comment by justin.h...@gmail.com on 30 May 2008 at 2:28