Skip to content

Commit

Permalink
Merge pull request #24615 from barredterra/widget-translatability
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra committed Feb 4, 2024
2 parents 860fe01 + a023435 commit 78f2004
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions frappe/public/js/frappe/widgets/widget_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,45 @@ class WidgetDialog {
}

get_title() {
// DO NOT REMOVE: Comment to load translation
// __("New Chart") __("New Shortcut") __("Edit Chart") __("Edit Shortcut")
if (this.editing) {
switch (this.type) {
case "chart":
return __("Edit Chart");
case "shortcut":
return __("Edit Shortcut");
case "links":
return __("Edit Links");
case "number_card":
return __("Edit Number Card");
case "onboarding":
return __("Edit Onboarding");
case "quick_list":
return __("Edit Quick List");
case "custom_block":
return __("Edit Custom Block");
default:
return __("Edit {0}", [__(frappe.model.unscrub(this.type))]);
}
}

let action = this.editing ? "Edit" : "Add";
let label = (action = action + " " + frappe.model.unscrub(this.type));
return __(label);
switch (this.type) {
case "chart":
return __("New Chart");
case "shortcut":
return __("New Shortcut");
case "links":
return __("New Links");
case "number_card":
return __("New Number Card");
case "onboarding":
return __("New Onboarding");
case "quick_list":
return __("New Quick List");
case "custom_block":
return __("New Custom Block");
default:
return __("New {0}", [__(frappe.model.unscrub(this.type))]);
}
}

get_fields() {
Expand Down

0 comments on commit 78f2004

Please sign in to comment.