From 41c7f2fd48ed15b8cb120b6864b3948e4ef1a56c Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 25 Jun 2026 17:30:25 +0530 Subject: [PATCH] chore: rewrite user-facing JS messages in Buying 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. --- .../doctype/purchase_order/purchase_order.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index bc175c8a736..0b78b2765a9 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -590,16 +590,14 @@ erpnext.buying.PurchaseOrderController = class PurchaseOrderController extends ( me.frm.doc.items[i].qty = my_qty; frappe.msgprint( - "Assigning " + - d.mr_name + - " to " + - d.item_code + - " (row " + - me.frm.doc.items[i].idx + - ")" + __("Assigning {0} to {1} (row {2})", [ + d.mr_name, + d.item_code, + me.frm.doc.items[i].idx, + ]) ); if (qty > 0) { - frappe.msgprint("Splitting " + qty + " units of " + d.item_code); + frappe.msgprint(__("Splitting {0} units of {1}", [qty, d.item_code])); var new_row = frappe.model.add_child( me.frm.doc, me.frm.doc.items[i].doctype,