From c2a98bf2e8151b7f6766b3e5f8f39d97a8f7d45c Mon Sep 17 00:00:00 2001 From: "Pratik Raval (PRRA)" Date: Fri, 22 Sep 2023 09:23:00 +0000 Subject: [PATCH] [FIX] website_forum: fix js template string translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some strings were not translated in website_forum because translation marks inside backticks will not be extracted to be translated. i.e., Markup`${_t("Please translate me"}, OK` will not work. This commit fixes the issue by explicit translation before putting it inside the backticks. Task-3462273 closes odoo/odoo#137857 X-original-commit: 5f33cdb8120661dad58eae9be1d6a511dc712bbd Signed-off-by: Thibault Delavallee (tde) --- addons/website_forum/i18n/website_forum.pot | 7 +++++++ addons/website_forum/static/src/js/website_forum.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/website_forum/i18n/website_forum.pot b/addons/website_forum/i18n/website_forum.pot index b929173fcd2..fb529db7baa 100644 --- a/addons/website_forum/i18n/website_forum.pot +++ b/addons/website_forum/i18n/website_forum.pot @@ -3917,6 +3917,13 @@ msgstr "" msgid "it is a rant disguised as a question: “______ sucks, am I right?”" msgstr "" +#. module: website_forum +#. odoo-javascript +#: code:addons/website_forum/static/src/js/website_forum.js:0 +#, python-format +msgid "karma is required to perform this action. " +msgstr "" + #. module: website_forum #. odoo-javascript #: code:addons/website_forum/static/src/xml/public_templates.xml:0 diff --git a/addons/website_forum/static/src/js/website_forum.js b/addons/website_forum/static/src/js/website_forum.js index 922dfbed185..2ea1f708384 100644 --- a/addons/website_forum/static/src/js/website_forum.js +++ b/addons/website_forum/static/src/js/website_forum.js @@ -280,11 +280,12 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({ ${_t("Read the guidelines to know how to gain karma.")} `) : ""; + const translatedText = _t("karma is required to perform this action. "); this.displayNotification({ type: "warning", sticky: false, title: _t("Karma Error"), - message: markup(`${karma} ${_t("karma is required to perform this action. ")}${additionalInfoWithForumID}`) + message: markup(`${karma} ${translatedText}${additionalInfoWithForumID}`) }); }, /**