[FIX] website_forum: fix js template string translations

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) <tde@openerp.com>
This commit is contained in:
Pratik Raval (PRRA)
2023-10-06 16:10:00 +00:00
parent d8a3374c43
commit c2a98bf2e8
2 changed files with 9 additions and 1 deletions
@@ -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
@@ -280,11 +280,12 @@ publicWidget.registry.websiteForum = publicWidget.Widget.extend({
${_t("Read the guidelines to know how to gain karma.")}
</a>`)
: "";
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}`)
});
},
/**