Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
3324 Переглядів

Hi everybody,

I've currently set up odoo12 with geoip detection. While it works great for detection of the visitor's country for using a correct website currency, it does fail to translate the website accordingly, as browser's language detection seems to have a higher priority than geoip.

Most of the users from my country use English as default for browsers but i'd still like to serve them the website in the home language.

Any idea how to disable the website translation by means of browser detection (i'd still like to keep geoip detection, though).

Thanks!

Аватар
Відмінити
Найкраща відповідь

change the value of field json_value in ir.default model where the record for default user language  is defined ...  getting it changed from "en_US" to "your_lang_code" through the shell command can be done by typing:
self.env['ir.default'].search([('json_value','=','"en_US"')]).json_value = ' "your_lang_code" '
self.env.cr.commit()

Аватар
Відмінити
Автор Найкраща відповідь

Thank you for your answer, Theo!

I have set the auto_redirect_lang flag to false, both in the shell, as well as in the DB. It seems, however, to have no effect. The website still redirects to the browser's preference, regardless of it.

I have a standard demo instance, no extra modules or modifications.

Does this work for you?

Аватар
Відмінити
Автор

Upon further investigation it seems that this flag has been added with the intention to also later add code that will handle this option:

https://github.com/odoo/odoo/commit/953a693df1284f2292237e3479a210ba28e6f9bf

However, I can not find any evidence of usage of the boolean in the entire codetree, regardless of the branch (includinv 14). I presume that it has never been added as a functionality.

Thanks again for pointing me to this, Theo. Unfortunately, noone at Odoo has bothered to implement this.

Найкраща відповідь

Try this switch in a shell (assuming your website ID is 1):

$ self.env['website'].browse(1).write({'auto_redirect_lang': False})
$ self.env.cr.commit()

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
5
серп. 25
9685
Carrusel en sitios web Вирішено
2
лип. 25
865
4
черв. 25
982
1
черв. 25
1305
1
трав. 25
1257