Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
3319 Vizualizări

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!

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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?

Imagine profil
Abandonează
Autor

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.

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
5
aug. 25
9659
2
iul. 25
839
4
iun. 25
967
1
iun. 25
1277
1
mai 25
1239