[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
@@ -3,7 +3,6 @@
import { Persona } from "@mail/core/common/persona_model";
import { _t } from "@web/core/l10n/translation";
import { patch } from "@web/core/utils/patch";
import { sprintf } from "@web/core/utils/strings";
patch(Persona.prototype, {
get countryFlagUrl() {
@@ -14,7 +13,7 @@ patch(Persona.prototype, {
},
get nameOrDisplayName() {
if (this.type === "visitor" && !this.name) {
return sprintf(_t("Visitor #%s"), this.id);
return _t("Visitor #%s", this.id);
}
return super.nameOrDisplayName;
},