Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
3 Odpowiedzi
10854 Widoki

Hi

how i can access fields values by java script ?

i tried to get language field value in java script variable, but i failed.

and i tried to know where is the function that retrieve the current language, and i failed too.

so please anyone can help me

Awatar
Odrzuć
Najlepsza odpowiedź
Confirm, this approach posted by Handelux worked like a charm, tested on v16
var lang = ('; '+document.cookie).split(`; frontend_lang=`).pop().split(';')[0];

Awatar
Odrzuć
Najlepsza odpowiedź

User language is stored in a cookie frontend_lang so you can access it with pure javascript:

var lang = ('; '+document.cookie).split(`; frontend_lang=`).pop().split(';')[0];
Awatar
Odrzuć
Najlepsza odpowiedź

The language value should be instance.session.user_context.lang.

Awatar
Odrzuć
Autor

please i am new in openerp. so where i can find "instance.session.user_context.lang" and how to put language in alert message

You need to read the OpenERP web module development guide. instance is sent by OpenERP to web modules during session startup.

Powiązane posty Odpowiedzi Widoki Czynność
0
lis 21
813
0
kwi 18
3141
0
wrz 21
1531
1
lis 21
15778
3
maj 25
626