my config is
'translator' => array(
'locale' => 'en_EN',
'translation_file_patterns' => array(
array(
'type' => 'gettext',
'base_dir' => __DIR__ . '/../language',
'pattern' => '%s.mo',
),
),
),
and how i can change locale from my view or controller?
Fetch the Translator
instance and invoke the setLocale()
method. Example (controller context):
// Get the translator from the service locator.
$translator = $this->getServiceLocator()->get('translator');
$translator->setLocale($myLocale);