[fix] Add missing translate function call (#25747)

* Update Properties.vue

* Update store.js

* Update Section.vue

* Update list_settings.js

* Update grid_row.js

* Update list_settings.js

* chore: add in missing context for some strings

Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>

* chore: formatting and lint fixes

Signed-off-by: Akhil Narang <me@akhilnarang.dev>

---------

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Akhil Narang <me@akhilnarang.dev>
Co-authored-by: Corentin Flr <10946971+cogk@users.noreply.github.com>
This commit is contained in:
Fisher Yu 2024-04-12 17:09:02 +08:00 committed by GitHub
parent 245fbb6459
commit ea61af2ceb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 18 deletions

View file

@ -260,14 +260,14 @@ function delete_column(with_children) {
const options = computed(() => {
let groups = [
{
group: "Section",
group: __("Section"),
items: [
{ label: __("Add section below"), onClick: add_section_below },
{ label: __("Remove section"), onClick: remove_section },
],
},
{
group: "Column",
group: __("Column"),
items: [{ label: __("Add column"), onClick: add_column }],
},
];

View file

@ -504,7 +504,7 @@ export default class GridRow {
);
if (selectedColumn && !selectedColumn.hidden && show_field(selectedColumn.fieldtype)) {
fields.push({
label: selectedColumn.label,
label: __(selectedColumn.label, null, this.grid.doctype),
value: selectedColumn.fieldname,
checked: true,
});
@ -519,7 +519,7 @@ export default class GridRow {
show_field(column.fieldtype)
) {
fields.push({
label: column.label,
label: __(column.label, null, this.grid.doctype),
value: column.fieldname,
checked: false,
});

View file

@ -118,7 +118,7 @@ export default class ListSettings {
${frappe.utils.icon("drag", "xs", "", "", "sortable-handle " + show_sortable_handle)}
</div>
<div class="col-10" style="padding-left:0px;">
${me.fields[idx].label}
${__(me.fields[idx].label, null, me.doctype)}
</div>
<div class="col-1 ${can_remove}">
<a class="text-muted remove-field" data-fieldname="${me.fields[idx].fieldname}">
@ -132,14 +132,14 @@ export default class ListSettings {
fields_html.html(`
<div class="form-group">
<div class="clearfix">
<label class="control-label" style="padding-right: 0px;">Fields</label>
<label class="control-label" style="padding-right: 0px;">${__("Fields")}</label>
</div>
<div class="control-input-wrapper">
${fields}
</div>
<p class="help-box small text-muted">
<a class="add-new-fields text-muted">
+ Add / Remove Fields
${__("+ Add / Remove Fields")}
</a>
</p>
</div>
@ -209,7 +209,7 @@ export default class ListSettings {
for (let idx = 0; idx < fields_order.length; idx++) {
me.fields.push({
fieldname: fields_order.item(idx).getAttribute("data-fieldname"),
label: fields_order.item(idx).getAttribute("data-label"),
label: __(fields_order.item(idx).getAttribute("data-label")),
});
}
@ -264,7 +264,7 @@ export default class ListSettings {
let field = frappe.meta.get_docfield(me.doctype, value);
if (field) {
me.fields.push({
label: field.label,
label: __(field.label, null, me.doctype),
fieldname: field.fieldname,
});
}
@ -320,7 +320,7 @@ export default class ListSettings {
me.subject_field.fieldname != field.fieldname
) {
me.fields.push({
label: field.label,
label: __(field.label, null, me.doctype),
fieldname: field.fieldname,
});
}
@ -331,7 +331,7 @@ export default class ListSettings {
let me = this;
me.subject_field = {
label: "ID",
label: __("ID"),
fieldname: "name",
};
@ -339,7 +339,7 @@ export default class ListSettings {
let field = frappe.meta.get_docfield(me.doctype, meta.title_field.trim());
me.subject_field = {
label: field.label,
label: __(field.label, null, me.doctype),
fieldname: field.fieldname,
};
}
@ -353,7 +353,7 @@ export default class ListSettings {
if (frappe.has_indicator(me.doctype)) {
me.fields.push({
type: "Status",
label: "Status",
label: __("Status"),
fieldname: "status_field",
});
}
@ -365,7 +365,7 @@ export default class ListSettings {
meta.fields.forEach((field) => {
if (!frappe.model.no_value_type.includes(field.fieldtype)) {
multiselect_fields.push({
label: field.label,
label: __(field.label, null, field.doctype),
value: field.fieldname,
checked: fields.includes(field.fieldname),
});

View file

@ -16,12 +16,12 @@ let properties = computed(() => {
if (field.val() === "") field.focus();
});
if (store.workflow.selected && "action" in store.workflow.selected.data) {
title.value = "Transition Properties";
title.value = __("Transition Properties");
return store.transitionfields.filter((df) =>
["action", "allowed", "allow_self_approval", "condition"].includes(df.fieldname)
);
} else if (store.workflow.selected && "state" in store.workflow.selected.data) {
title.value = "State Properties";
title.value = __("State Properties");
let allow_edit = store.statefields.find((df) => df.fieldname == "allow_edit");
store.statefields = store.statefields.filter(
(df) => !["allow_edit", "workflow_builder_id"].includes(df.fieldname)
@ -39,7 +39,7 @@ let properties = computed(() => {
return true;
});
}
title.value = "Workflow Details";
title.value = __("Workflow Details");
return store.workflowfields.filter(
(df) => !["states", "transitions", "workflow_data", "workflow_name"].includes(df.fieldname)
);

View file

@ -80,7 +80,7 @@ export const useStore = defineStore("workflow-builder-store", () => {
const workflow_data = clean_workflow_data();
doc.workflow_data = JSON.stringify(workflow_data);
await frappe.call("frappe.client.save", { doc });
frappe.toast("Workflow updated successfully");
frappe.toast(__("Workflow updated successfully"));
fetch();
} catch (e) {
console.error(e);