From c5e911dd07889bacbe30fdb8a07b11fcd4df8691 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 25 Jun 2026 17:26:47 +0530 Subject: [PATCH] chore: rewrite user-facing JS messages in Selling 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/selling/doctype/customer/customer.js | 2 +- erpnext/selling/doctype/sales_order/sales_order.js | 4 ++-- erpnext/selling/page/point_of_sale/pos_controller.js | 2 +- erpnext/selling/page/point_of_sale/pos_past_order_summary.js | 2 +- erpnext/selling/page/point_of_sale/pos_payment.js | 4 ++-- erpnext/selling/page/sales_funnel/sales_funnel.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index b4c5a7f3064..a21cc00b991 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -279,7 +279,7 @@ frappe.ui.form.on("Customer", { error: function () { dialog.hide(); frappe.msgprint({ - message: __("Linking to Supplier Failed. Please try again."), + message: __("Linking to Supplier failed. Please try again."), title: __("Linking Failed"), indicator: "red", }); diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 1555983bf01..6a27febe21a 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -1365,7 +1365,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex primary_action: function () { var data = { items: d.fields_dict.items.grid.get_selected_children() }; if (!data.items.length) { - frappe.throw(__("Please select atleast one item to continue")); + frappe.throw(__("Please select at least one item to continue")); } me.frm.call({ method: "make_work_orders", @@ -1753,7 +1753,7 @@ erpnext.selling.SalesOrderController = class SalesOrderController extends erpnex let selected_items = dialog.fields_dict.items_for_po.grid.get_selected_children(); if (selected_items.length == 0) { frappe.throw({ - message: "Please select Items from the Table", + message: __("Please select Items from the Table"), title: __("Items Required"), indicator: "blue", }); diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js index 94acb5cf932..9e35eed2bcd 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -824,7 +824,7 @@ erpnext.PointOfSale.Controller = class { } else if (is_stock_item && available_qty < qty_needed) { frappe.throw({ message: __( - "Stock quantity not enough for Item Code: {0} under warehouse {1}. Available quantity {2} {3}.", + "Stock quantity is not enough for Item Code: {0} under warehouse {1}. Available quantity {2} {3}.", [bold_item_code, bold_warehouse, bold_available_qty, bold_uom] ), indicator: "orange", diff --git a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js index d59b50c60ad..721f5c8fbba 100644 --- a/erpnext/selling/page/point_of_sale/pos_past_order_summary.js +++ b/erpnext/selling/page/point_of_sale/pos_past_order_summary.js @@ -201,7 +201,7 @@ erpnext.PointOfSale.PastOrderSummary = class { frappe.msgprint({ title: __("Invalid Return"), indicator: "orange", - message: __("All the items have been already returned."), + message: __("All the items have already been returned."), }); return; } diff --git a/erpnext/selling/page/point_of_sale/pos_payment.js b/erpnext/selling/page/point_of_sale/pos_payment.js index bf8c9f44049..907070154fd 100644 --- a/erpnext/selling/page/point_of_sale/pos_payment.js +++ b/erpnext/selling/page/point_of_sale/pos_payment.js @@ -278,7 +278,7 @@ erpnext.PointOfSale.Payment = class { ) { const message = items.length ? __("You cannot submit the order without payment.") - : __("You cannot submit empty order."); + : __("You cannot submit an empty order."); frappe.show_alert({ message, indicator: "orange" }); frappe.utils.play_sound("error"); return; @@ -592,7 +592,7 @@ erpnext.PointOfSale.Payment = class { flt(loyalty_points) * flt(conversion_factor), precision("loyalty_amount", doc) ); - description = __("You can redeem upto {0}.", [format_currency(max_redeemable_amount)]); + description = __("You can redeem up to {0}.", [format_currency(max_redeemable_amount)]); read_only = false; } diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.js b/erpnext/selling/page/sales_funnel/sales_funnel.js index a819c72dc80..2af2caf844c 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.js +++ b/erpnext/selling/page/sales_funnel/sales_funnel.js @@ -111,7 +111,7 @@ erpnext.SalesFunnel = class SalesFunnel { get_data(btn) { var me = this; if (!this.company) { - frappe.throw(__("Please Select a Company.")); + frappe.throw(__("Please select a company.")); } const method_map = {