Skip to content

Commit 8908de0

Browse files
committed
[FIX] im_livechat: fix translations for embed live chat
Before this commit, templates of the live chat embed were not translated. Indeed, translations for the live chat module are never loaded. This commit fixes the issue by loading the live chat translations at the same time templates are loaded. opw-3509309 closes odoo#141819 Signed-off-by: Alexandre Kühn (aku) <[email protected]>
1 parent 6b0282c commit 8908de0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

addons/im_livechat/static/src/legacy/public_livechat.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,13 @@ var LivechatButton = Widget.extend({
8484
}
8585
this._rule = result.rule;
8686
}
87-
return this._loadQWebTemplate();
87+
const proms = [this._loadQWebTemplate()];
88+
// Translations are already loaded in Odoo frontend. Only load them if
89+
// we are in an external page.
90+
if (!session.is_frontend) {
91+
proms.push(session.load_translations(["im_livechat"]));
92+
}
93+
return Promise.all(proms);
8894
},
8995
start: function () {
9096
this.$el.text(this.options.button_text);

0 commit comments

Comments
 (0)