Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
3312 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

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
Abbandona
Autore

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.

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
5
ago 25
9646
2
lug 25
823
4
giu 25
954
1
giu 25
1266
1
mag 25
1230