From ac22fd036040c577a7d9571e4e9c668736fa7227 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 25 Jun 2026 16:33:50 +0530 Subject: [PATCH] chore: rewrite user-facing JS messages in Accounts module Conservative cleanup of frappe.throw/msgprint messages per the message style guide; meaning, severity, and .format() arguments are unchanged: - index bare {} placeholders as {0}/{1}/... so translators can reorder - move f-strings / .format() / concatenation out of _() (they break gettext extraction and never translate) - wrap translatable dynamic values (DocType/Select labels) in _() - fix grammar and colloquialisms - drop no-op _() wrapping runtime-built strings Part of #53976. --- erpnext/accounts/doctype/account/account_tree.js | 6 +++--- .../exchange_rate_revaluation.js | 2 +- .../doctype/loyalty_program/loyalty_program.js | 4 ++-- .../accounts/doctype/payment_entry/payment_entry.js | 2 +- .../process_payment_reconciliation.js | 4 ++-- .../process_statement_of_accounts.js | 10 +++++----- .../accounts/doctype/sales_invoice/sales_invoice.js | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index 5ff4e4a47e2..0248fab4602 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -236,9 +236,9 @@ frappe.treeview_settings["Account"] = { function () { let root_company = treeview.page.fields_dict.root_company.get_value(); if (root_company) { - frappe.throw(__("Please add the account to root level Company - {0}"), [ - root_company, - ]); + frappe.throw( + __("Please add the account to root level Company - {0}", [root_company]) + ); } else { treeview.new_node(); } diff --git a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js index 5efd3239341..2637e49d00a 100644 --- a/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js +++ b/erpnext/accounts/doctype/exchange_rate_revaluation/exchange_rate_revaluation.js @@ -136,7 +136,7 @@ frappe.ui.form.on("Exchange Rate Revaluation Account", { var get_account_details = function (frm, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); if (!frm.doc.company || !frm.doc.posting_date) { - frappe.throw(__("Please select Company and Posting Date to getting entries")); + frappe.throw(__("Please select Company and Posting Date to get entries")); } frappe.call({ method: "erpnext.accounts.doctype.exchange_rate_revaluation.exchange_rate_revaluation.get_account_details", diff --git a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js index 4c29be3b556..9c9b46c66f5 100644 --- a/erpnext/accounts/doctype/loyalty_program/loyalty_program.js +++ b/erpnext/accounts/doctype/loyalty_program/loyalty_program.js @@ -36,7 +36,7 @@ frappe.ui.form.on("Loyalty Program", { )}
  • - ${__("One customer can be part of only single Loyalty Program.")} + ${__("One customer can be part of only a single Loyalty Program.")}
  • @@ -62,7 +62,7 @@ frappe.ui.form.on("Loyalty Program", { refresh: function (frm) { if (frm.doc.loyalty_program_type === "Single Tier Program" && frm.doc.collection_rules.length > 1) { frappe.throw( - __("Please select the Multiple Tier Program type for more than one collection rules.") + __("Please select the Multiple Tier Program type for more than one collection rule.") ); } }, diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.js b/erpnext/accounts/doctype/payment_entry/payment_entry.js index ddb7dbacb0b..3a0d1d11f4c 100644 --- a/erpnext/accounts/doctype/payment_entry/payment_entry.js +++ b/erpnext/accounts/doctype/payment_entry/payment_entry.js @@ -977,7 +977,7 @@ frappe.ui.form.on("Payment Entry", { let to_field = fields[key][1]; if (filters[from_field] && !filters[to_field]) { - frappe.throw(__("Error: {0} is mandatory field", [to_field.replace(/_/g, " ")])); + frappe.throw(__("Error: {0} is a mandatory field", [to_field.replace(/_/g, " ")])); } else if (filters[from_field] && filters[from_field] > filters[to_field]) { frappe.throw( __("{0}: {1} must be less than {2}", [ diff --git a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js index d72c4724690..6ac196fbcc6 100644 --- a/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js +++ b/erpnext/accounts/doctype/process_payment_reconciliation/process_payment_reconciliation.js @@ -61,7 +61,7 @@ frappe.ui.form.on("Process Payment Reconciliation", { }, }).then((r) => { if (!r.exc) { - frappe.show_alert(__("Job Started")); + frappe.show_alert(__("Job started")); frm.reload_doc(); } }); @@ -103,7 +103,7 @@ frappe.ui.form.on("Process Payment Reconciliation", { }, }).then((r) => { if (!r.exc) { - frappe.show_alert(__("Job Paused")); + frappe.show_alert(__("Job paused")); frm.reload_doc(); } }); diff --git a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js index eaaf50145c6..e797f783e25 100644 --- a/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js +++ b/erpnext/accounts/doctype/process_statement_of_accounts/process_statement_of_accounts.js @@ -17,9 +17,9 @@ frappe.ui.form.on("Process Statement Of Accounts", { }, callback: function (r) { if (r && r.message) { - frappe.show_alert({ message: __("Emails Queued"), indicator: "blue" }); + frappe.show_alert({ message: __("Emails queued"), indicator: "blue" }); } else { - frappe.msgprint(__("No Records for these settings.")); + frappe.msgprint(__("No records for these settings.")); } }, }); @@ -36,7 +36,7 @@ frappe.ui.form.on("Process Statement Of Accounts", { type: "GET", success: function (result) { if (jQuery.isEmptyObject(result)) { - frappe.msgprint(__("No Records for these settings.")); + frappe.msgprint(__("No records for these settings.")); } else { window.location = url; } @@ -161,13 +161,13 @@ frappe.ui.form.on("Process Statement Of Accounts", { } frm.refresh_field("customers"); } else { - frappe.throw(__("No Customers found with selected options.")); + frappe.throw(__("No customers found with selected options.")); } } }, }); } else { - frappe.throw("Enter " + frm.doc.customer_collection + " name."); + frappe.throw(__("Enter {0} name.", [frm.doc.customer_collection])); } }, }); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 5f5a078bd4f..1c6a99edb03 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -436,7 +436,7 @@ erpnext.accounts.SalesInvoiceController = class SalesInvoiceController extends ( if (!me.frm.doc.customer) { frappe.throw({ title: __("Mandatory"), - message: __("Please Select a Customer"), + message: __("Please select a Customer"), }); } erpnext.utils.map_current_doc({