Hi,
I installed a new language in opencart, with order 1 and english 2, changed it in the admin -> setting but when I go to the admin is in english... I checked the session table and is english, I dont know why it doesnt works!!!
Any hint? fix?
I need to setup up the new language as default for the front-end and the backend.
Thanks all!
In the file library\language\language.php you will find the following code...
It chooses the language from the first of
For initial testing, clear all cookies etc to remove the current session.
Code: Select all
if (array_key_exists($this->session->get('language'), $this->languages)) {
$this->set($this->session->get('language'));
} elseif (array_key_exists($this->request->get('language', 'cookie'), $this->languages)) {
$this->set($this->request->get('language', 'cookie'));
} elseif ($browser = $this->detect()) {
$this->set($browser);
} else {
$this->set($this->config->get('config_language'));
}
- session... the user has selected a language from the language selector
- cookie... the user has selected a language from the language selector in a previous session
- browser language using the detect() function in the same file as the above
- admin setting
Code: Select all
if (array_key_exists($this->session->get('language'), $this->languages)) {
$this->set($this->session->get('language'));
} else {
$this->set($this->config->get('config_language'));
}
Maybe I found the problem. Im Italy, with english version of windows but Opera browser is Italian.
I think thats not good solution to detect the browser language instead get language from country ( with the ip )
I fix the code, thanks.
I think thats not good solution to detect the browser language instead get language from country ( with the ip )
I fix the code, thanks.
Who is online
Users browsing this forum: No registered users and 2 guests