From ec2174f683e443348f06c8b50d5025cf38e8d1cc Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Fri, 19 Mar 2021 14:51:35 +0000 Subject: [PATCH] [FIX] web: fix incorrect translation of template literals closes odoo/odoo#68159 X-original-commit: 34549b6e0f99e09551533af5756a991d8e47812c Signed-off-by: Christophe Monniez (moc) --- addons/web/i18n/web.pot | 7 ++----- .../static/src/js/views/basic/basic_model.js | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot index 420603cf4e6..f356a547bbb 100644 --- a/addons/web/i18n/web.pot +++ b/addons/web/i18n/web.pot @@ -90,8 +90,7 @@ msgstr "" #: code:addons/web/static/src/js/views/basic/basic_model.js:0 #, python-format msgid "" -"'${referenceFieldName}' is unsynchronized\n" -" with '${modelFieldName}'." +"'%s' is unsynchronized with '%s'." msgstr "" #. module: web @@ -2076,9 +2075,7 @@ msgstr "" #: code:addons/web/static/src/js/views/basic/basic_model.js:0 #, python-format msgid "" -"If you change ${modelFieldName} or\n" -" ${referenceFieldName}, the synchronization\n" -" will be reapplied and the data will be modified." +"If you change %s or %s, the synchronization will be reapplied and the data will be modified." msgstr "" #. module: web diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 8a420d4cea1..4b86e45636e 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2434,11 +2434,19 @@ var BasicModel = AbstractModel.extend({ const modelFieldName = record.fields[modelField].string; const referenceFieldName = record.fields[fieldName].string; - this.do_warn(_t(`'${referenceFieldName}' is unsynchronized - with '${modelFieldName}'.`), - _t(`If you change ${modelFieldName} or - ${referenceFieldName}, the synchronization - will be reapplied and the data will be modified.`), true); + this.do_warn( + _.str.sprintf( + _t(`'%s' is unsynchronized with ''.`), + referenceFieldName, + modelFieldName, + ), + _.str.sprintf( + _t(`If you change %s or %s, the synchronization will be reapplied and the data will be modified.`), + modelFieldName, + referenceFieldName, + ), + true, + ); return false; } return {