[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:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user