Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
3310 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Autor Mejor respuesta

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
Descartar
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.

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
5
ago 25
9611
2
jul 25
805
4
jun 25
932
1
jun 25
1252
1
may 25
1205