From ffec6256de1872e8a4d1e19e5114041b40e71906 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Mon, 19 Apr 2021 11:31:47 +0000 Subject: [PATCH] [FIX] web: web_translation route lang required The /web/webclient/translations route's `lang` argument has had some changes in the last year: - before june 2020 (a9a756cf): very often it was set to null - after june 2020 (a9a756cf): it was more often correctly set or had en_US as fallback so never null - after 31 march 2021 (8cc06617) in saas-14.3: lang is not sent to server if it is null (which should never happen) - after 15 april 2021 (a93a0a3): en_US fallback is removed to prevent overriding server language if another language is better But the fix in 31 march and 15 april are not compatible because the route /web/webclient/translations require a lang argument. With this changeset, lang argument is always sent to the server. closes odoo/odoo#69487 X-original-commit: 0604dce996882fb93cd71885f7eb4d0749eb357f Signed-off-by: Nicolas Lempereur (nle) --- addons/web/static/src/js/core/translation.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web/static/src/js/core/translation.js b/addons/web/static/src/js/core/translation.js index 169cf9422e8..81b220e1e76 100644 --- a/addons/web/static/src/js/core/translation.js +++ b/addons/web/static/src/js/core/translation.js @@ -70,9 +70,7 @@ var TranslationDataBase = Class.extend(/** @lends instance.TranslationDataBase# if (modules) { paramsGet.modules = modules.join(','); } - if (lang) { - paramsGet.lang = lang; - } + paramsGet.lang = lang || null; return $.get(url, paramsGet).then(function (trans) { self.set_bundle(trans); });