diff options
Diffstat (limited to 'addons/web/static/src/js/core/session.js')
| -rw-r--r-- | addons/web/static/src/js/core/session.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/addons/web/static/src/js/core/session.js b/addons/web/static/src/js/core/session.js index 354cca6d6f8..ae31b95696d 100644 --- a/addons/web/static/src/js/core/session.js +++ b/addons/web/static/src/js/core/session.js @@ -211,15 +211,13 @@ var Session = core.Class.extend(mixins.EventDispatcherMixin, { }); }, load_translations: function () { - var lang = this.user_context.lang; - - if (!lang) { - this.trigger_up('context_get', { - callback: function (ctx) { - lang = ctx.lang; - }, - }); - } + /* We need to get the website lang at this level. + The only way is to get it is to take the HTML tag lang + Without it, we will always send undefined if there is no lang + in the user_context. */ + var html = document.documentElement, + htmlLang = (html.getAttribute('lang') || 'en_US').replace('-', '_'), + lang = this.user_context.lang || htmlLang; return _t.database.load_translations(this, this.module_list, lang, this.translationURL); }, |
