Merge pull request #33529 from HarryPaulo/fix-translate-labels-on-dashboards
fix: translate dashboards legends
This commit is contained in:
commit
4a10b41ea7
1 changed files with 6 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ frappe.report_utils = {
|
|||
|
||||
let labels = get_column_values(x_field);
|
||||
let datasets = y_fields.map((y_field) => ({
|
||||
name: frappe.model.unscrub(y_field),
|
||||
name: get_translated_column_label(y_field),
|
||||
values: get_column_values(y_field).map((d) => Number(d)),
|
||||
}));
|
||||
|
||||
|
|
@ -47,6 +47,11 @@ frappe.report_utils = {
|
|||
return rows.map((row) => row[column_name]);
|
||||
}
|
||||
}
|
||||
|
||||
function get_translated_column_label(fieldname) {
|
||||
let column = columns.find((column) => column.fieldname === fieldname);
|
||||
return column?.label ?? __(frappe.model.unscrub(fieldname));
|
||||
}
|
||||
},
|
||||
|
||||
get_field_options_from_report: function (columns, data) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue