Skip to Content
Menu
This question has been flagged
3 Replies
2543 Views

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!

Avatar
Discard
Best Answer

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()

Avatar
Discard
Author Best Answer

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?

Avatar
Discard
Author

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.

Best Answer

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()

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 24
1
0
Dec 24
36
2
Sep 24
340
1
Oct 24
602
3
Jul 24
2165