centurion-project/Centurion — Issue #47: Translatable linked datas displayed in wrong language
Author: DiaFR
Created: 2012-02-20 11:21:49+00:00
State: open

when displaying translatable datas in back office, browser language is used instead of back office language
this is due to "new Zend_Locale()" instanciation in library/Centurion/Contrib/translation/controllers/helpers/ManageLanguageParam.php
without nay param, it takes brower language
language should be the one used in back office

possible fix:
$controller = $this->getActionController();
if (!($requestedLocale = $controller->getRequest()->getParam('language', false))) {
$bootstrap = $controller->getInvokeArg('bootstrap');
$options = $bootstrap->getOptions();
$default = null;

if (isset($options['resources']['locale']['force']) && (1 == $options['resources']['locale']['force']))
{
$default = $options['resources']['locale']['default'];
}

$local = new Zend_Locale($default);
$requestedLocale = $local->getLanguage();
}