[IMP] *: unify sprintf and gettext

Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit is contained in:
Louis Wicket (wil)
2023-08-10 18:14:04 +02:00
parent 62fba62067
commit f1722c7334
123 changed files with 353 additions and 495 deletions
@@ -1,6 +1,6 @@
/** @odoo-module **/
import { escape, sprintf } from "@web/core/utils/strings";
import { escape } from "@web/core/utils/strings";
import core from "@web/legacy/js/services/core";
import Dialog from "@web/legacy/js/core/dialog";
import { _t } from "@web/core/l10n/translation";
@@ -77,7 +77,7 @@
const $checkedRadios = this.$('input[name="o_payment_radio"]:checked');
if ($checkedRadios.length !== 1) { // Cannot find selected payment option, show dialog
return new Dialog(null, {
title: sprintf(_t("Error: %s"), title),
title: _t("Error: %s", title),
size: 'medium',
$content: `<p>${escape(description) || ''}</p>`,
buttons: [{text: _t("Ok"), close: true}]