Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translatable linked datas displayed in wrong language #47

Open
aurmil opened this issue Feb 20, 2012 · 0 comments
Open

Translatable linked datas displayed in wrong language #47

aurmil opened this issue Feb 20, 2012 · 0 comments
Labels

Comments

@aurmil
Copy link

aurmil commented Feb 20, 2012

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();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant