[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:
+1
-2
@@ -1,13 +1,12 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { sprintf } from "@web/core/utils/strings";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { PriorityField, priorityField } from "@web/views/fields/priority/priority_field";
|
||||
|
||||
export class PrioritySwitchField extends PriorityField {
|
||||
get commands() {
|
||||
return this.options.map(([id, name]) => [
|
||||
sprintf(this.env._t("Set priority as %s"), name),
|
||||
this.env._t("Set priority as %s", name),
|
||||
() => this.updateRecord(id),
|
||||
{
|
||||
category: "smart_action",
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ import {
|
||||
StateSelectionField,
|
||||
stateSelectionField,
|
||||
} from "@web/views/fields/state_selection/state_selection_field";
|
||||
import { sprintf } from "@web/core/utils/strings";
|
||||
import { useCommand } from "@web/core/commands/command_hook";
|
||||
import { formatSelection } from "@web/views/fields/formatters";
|
||||
|
||||
@@ -44,7 +43,7 @@ export class ProjectTaskStateSelection extends StateSelectionField {
|
||||
if (this.props.viewType != 'form') {
|
||||
super.setup();
|
||||
} else {
|
||||
const commandName = sprintf(this.env._t(`Set state as...`));
|
||||
const commandName = this.env._t("Set state as...");
|
||||
useCommand(
|
||||
commandName,
|
||||
() => {
|
||||
|
||||
Reference in New Issue
Block a user