[FIX] mail: fix messaging locale update on translation bundle change
closes odoo/odoo#55167 X-original-commit: c3eb3f04e06cea84dd98323b6d10867dead5b953 Signed-off-by: Sébastien Theys (seb) <seb@odoo.com> Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
odoo.define('mail/static/src/js/core/translation.js', function (require) {
|
||||
'use strict';
|
||||
|
||||
const { TranslationDataBase } = require('web.translation');
|
||||
|
||||
const { Component } = owl;
|
||||
|
||||
TranslationDataBase.include({
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
set_bundle() {
|
||||
const res = this._super(...arguments);
|
||||
if (Component.env.messaging) {
|
||||
// Update messaging locale whenever the translation bundle changes.
|
||||
// In particular if messaging is created before the end of the
|
||||
// `load_translations` RPC, the default text direction has to be
|
||||
// updated by the received one.
|
||||
Component.env.messaging.locale.update({
|
||||
textDirection: this.parameters.direction,
|
||||
});
|
||||
}
|
||||
return res;
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
<template id="assets_backend" name="mail assets" inherit_id="web.assets_backend">
|
||||
<xpath expr="." position="inside">
|
||||
<script type="text/javascript" src="/mail/static/src/js/core/translation.js"></script>
|
||||
|
||||
<script type="text/javascript" src="/mail/static/src/js/many2many_tags_email.js"></script>
|
||||
<script type="text/javascript" src="/mail/static/src/js/many2one_avatar_user.js"></script>
|
||||
<script type="text/javascript" src="/mail/static/src/js/field_char.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user