Community mailing list archives
Re: Odoo Website Language problemby
Md. Tanzilul Hasan Khan
I am using following line of code, can anyone please suggest what I am doing wrong? I can't revert back the website to English after changing the language. English is set as default language -
<a href="#" class="dropdown-toggle language" data-toggle="dropdown">
<b><i></i> Language <span class="caret"></span></b>
<ul class="dropdown-menu" id="login_dropdown">
<t t-foreach="languages" t-as="lg">
<a t-att-href="url_for(request.httprequest.path + '?' + keep_query(), lang=lg)"
t-att-data-default-lang="editable and 'true' if lg == website.default_lang_code else None">
I also debugged the code in website controller, it seems that in the following line -
return WebClient().translations(mods=modules, lang=lang)
The lang=lang never gets English (except first time) when I am changing it from website dropdown. It is stuck to de_DE or to another language. If I have three or four languages, other language works fine except English.