From 7e1ba0de4137360f4a8a771431f14c55c384754d Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Thu, 18 Mar 2021 12:37:08 +0000 Subject: [PATCH] [FIX] web, web_editor, website: fix incorrectly translated template literals closes odoo/odoo#68105 X-original-commit: e1d280880c26d6139dc6a3679fb7df7e07defdd6 Signed-off-by: Christophe Monniez (moc) --- addons/web/i18n/web.pot | 2 +- addons/web/static/src/js/fields/relational_fields.js | 2 +- addons/web_editor/i18n/web_editor.pot | 2 +- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- addons/website/i18n/website.pot | 8 ++++---- addons/website/static/src/js/tours/tour_utils.js | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/web/i18n/web.pot b/addons/web/i18n/web.pot index 91292e83ed6..420603cf4e6 100644 --- a/addons/web/i18n/web.pot +++ b/addons/web/i18n/web.pot @@ -2572,7 +2572,7 @@ msgstr "" #. openerp-web #: code:addons/web/static/src/js/fields/relational_fields.js:0 #, python-format -msgid "New ${this.name}" +msgid "New %s" msgstr "" #. module: web diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index 311f98596fc..b0fd1fbb3cb 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -44,7 +44,7 @@ var M2ODialog = Dialog.extend({ this.name = name; this.value = value; this._super(parent, { - title: _t(`New ${this.name}`), + title: _.str.sprintf(_t("New %s"), this.name), size: 'medium', buttons: [{ text: _t('Create'), diff --git a/addons/web_editor/i18n/web_editor.pot b/addons/web_editor/i18n/web_editor.pot index d3a9af38e89..4430528b938 100644 --- a/addons/web_editor/i18n/web_editor.pot +++ b/addons/web_editor/i18n/web_editor.pot @@ -232,7 +232,7 @@ msgstr "" #: code:addons/web_editor/static/src/js/editor/snippets.editor.js:0 #, python-format msgid "" -"Are you sure you want to delete the snippet: ${$snippet.attr('name')} ?" +"Are you sure you want to delete the snippet: %s ?" msgstr "" #. module: web_editor diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 73c4b53b540..968f53c96c7 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2468,7 +2468,7 @@ var SnippetsMenu = Widget.extend({ new Dialog(this, { size: 'medium', title: _t('Confirmation'), - $content: $('

' + _t(`Are you sure you want to delete the snippet: ${$snippet.attr('name')} ?`) + '

'), + $content: $('

' + _.str.sprintf(_t("Are you sure you want to delete the snippet: %s ?"), $snippet.attr('name')) + '

'), buttons: [{ text: _t("Yes"), close: true, diff --git a/addons/website/i18n/website.pot b/addons/website/i18n/website.pot index d64bb09125d..0acd0e4a188 100644 --- a/addons/website/i18n/website.pot +++ b/addons/website/i18n/website.pot @@ -363,7 +363,7 @@ msgstr "" #: code:addons/website/static/src/js/tours/tour_utils.js:0 #, python-format msgid "" -"Click on this option to change the ${optionTooltipLabel} of the " +"Click on this option to change the %s of the " "block." msgstr "" @@ -420,7 +420,7 @@ msgstr "" #. openerp-web #: code:addons/website/static/src/js/tours/tour_utils.js:0 #, python-format -msgid "Select a ${optionTooltipLabel}." +msgid "Select a %s." msgstr "" #. module: website @@ -434,7 +434,7 @@ msgstr "" #. openerp-web #: code:addons/website/static/src/js/tours/tour_utils.js:0 #, python-format -msgid "Slide this button to change the ${direction} padding" +msgid "Slide this button to change the %s padding" msgstr "" #. module: website @@ -2712,7 +2712,7 @@ msgstr "" #: code:addons/website/static/src/js/tours/tour_utils.js:0 #, python-format msgid "" -"Drag the ${snippet.name} building block and drop it at the bottom of your page." +"Drag the %s building block and drop it at the bottom of your page." msgstr "" #. module: website diff --git a/addons/website/static/src/js/tours/tour_utils.js b/addons/website/static/src/js/tours/tour_utils.js index e11e9f7ef3b..84be86fa913 100644 --- a/addons/website/static/src/js/tours/tour_utils.js +++ b/addons/website/static/src/js/tours/tour_utils.js @@ -108,7 +108,7 @@ function changeOption(optionName, weName = '', optionTooltipLabel = '', position const option_block = `we-customizeblock-option[class='snippet-option-${optionName}']` return { trigger: `${option_block} ${weName}, ${option_block} [title='${weName}']`, - content: _t(`Click on this option to change the ${optionTooltipLabel} of the block.`), + content: _.str.sprintf(_t("Click on this option to change the %s of the block."), optionTooltipLabel), position: position, run: "click", }; @@ -118,7 +118,7 @@ function selectNested(trigger, optionName, alt_trigger = null, optionTooltipLabe const option_block = `we-customizeblock-option[class='snippet-option-${optionName}']`; return { trigger: trigger, - content: _t(`Select a ${optionTooltipLabel}.`), + content: _.str.sprintf(_t("Select a %s."), optionTooltipLabel), alt_trigger: alt_trigger == null ? undefined : `${option_block} ${alt_trigger}`, position: position, run: 'click', @@ -135,7 +135,7 @@ function changePaddingSize(direction) { } return { trigger: `.oe_overlay.ui-draggable.o_we_overlay_sticky.oe_active .o_handle.${paddingDirection}`, - content: _t(`Slide this button to change the ${direction} padding`), + content: _.str.sprintf(_t("Slide this button to change the %s padding"), direction), position: position, }; } @@ -202,7 +202,7 @@ function dragNDrop(snippet, position = "bottom") { trigger: `#oe_snippets .oe_snippet[name="${snippet.name}"] .oe_snippet_thumbnail:not(.o_we_already_dragging)`, extra_trigger: "body.editor_enable.editor_has_snippets", moveTrigger: '.oe_drop_zone', - content: _t(`Drag the ${snippet.name} building block and drop it at the bottom of the page.`), + content: _.str.sprintf(_t("Drag the %s building block and drop it at the bottom of the page."), snippet.name), position: position, run: "drag_and_drop #wrap", };