Browse Source

Merge pull request #13341 from alyf-de/messages-translation-context

feat: add context to strings in confirm and prompt dialogs
version-14
mergify[bot] 4 years ago
committed by GitHub
parent
commit
75a5eb2444
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      frappe/public/js/frappe/ui/messages.js

+ 5
- 5
frappe/public/js/frappe/ui/messages.js View File

@@ -26,13 +26,13 @@ frappe.throw = function(msg) {


frappe.confirm = function(message, confirm_action, reject_action) { frappe.confirm = function(message, confirm_action, reject_action) {
var d = new frappe.ui.Dialog({ var d = new frappe.ui.Dialog({
title: __("Confirm"),
primary_action_label: __("Yes"),
title: __("Confirm", null, "Title of confirmation dialog"),
primary_action_label: __("Yes", null, "Approve confirmation dialog"),
primary_action: () => { primary_action: () => {
confirm_action && confirm_action(); confirm_action && confirm_action();
d.hide(); d.hide();
}, },
secondary_action_label: __("No"),
secondary_action_label: __("No", null, "Dismiss confirmation dialog"),
secondary_action: () => d.hide(), secondary_action: () => d.hide(),
}); });


@@ -88,9 +88,9 @@ frappe.prompt = function(fields, callback, title, primary_label) {
if(!$.isArray(fields)) fields = [fields]; if(!$.isArray(fields)) fields = [fields];
var d = new frappe.ui.Dialog({ var d = new frappe.ui.Dialog({
fields: fields, fields: fields,
title: title || __("Enter Value"),
title: title || __("Enter Value", null, "Title of prompt dialog"),
}); });
d.set_primary_action(primary_label || __("Submit"), function() {
d.set_primary_action(primary_label || __("Submit", null, "Primary action of prompt dialog"), function() {
var values = d.get_values(); var values = d.get_values();
if(!values) { if(!values) {
return; return;


Loading…
Cancel
Save