fix: rewrite user-facing 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.
This commit is contained in:
Mihir Kandoi
2026-06-25 16:15:33 +05:30
parent 9b4c8a8d7f
commit 600bf9e249
3 changed files with 4 additions and 4 deletions

View File

@@ -36,7 +36,7 @@ class SubcontractingService:
)
)
if not item.fg_item_qty:
frappe.throw(_("Row #{0}: Finished Good Item Qty can not be zero").format(item.idx))
frappe.throw(_("Row #{0}: Finished Good Item Qty cannot be zero").format(item.idx))
else:
for item in doc.items:
item.set("fg_item", None)

View File

@@ -421,7 +421,7 @@ def check_portal_enabled(reference_doctype):
if not frappe.db.get_value("Portal Menu Item", {"reference_doctype": reference_doctype}, "enabled"):
frappe.throw(
_(
"The Access to Request for Quotation From Portal is Disabled. To Allow Access, Enable it in Portal Settings."
"Access to Request for Quotation from the portal is disabled. To allow access, enable it in Portal Settings."
)
)

View File

@@ -43,11 +43,11 @@ class SupplierScorecardVariable(Document):
import_string_path(self.path)
except AttributeError:
frappe.throw(_("Could not find path for " + self.path), VariablePathNotFound)
frappe.throw(_("Could not find path for {0}").format(self.path), VariablePathNotFound)
else:
if not hasattr(sys.modules[__name__], self.path):
frappe.throw(_("Could not find path for " + self.path), VariablePathNotFound)
frappe.throw(_("Could not find path for {0}").format(self.path), VariablePathNotFound)
def get_total_workdays(scorecard):