mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 23:18:40 +00:00
chore: rewrite user-facing messages in Setup 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:
@@ -46,7 +46,9 @@ class ItemGroup(NestedSet):
|
||||
frappe.throw(
|
||||
_("{0} entered twice {1} in Item Taxes").format(
|
||||
frappe.bold(d.item_tax_template),
|
||||
f"for tax category {frappe.bold(d.tax_category)}" if d.tax_category else "",
|
||||
_("for tax category {0}").format(frappe.bold(d.tax_category))
|
||||
if d.tax_category
|
||||
else "",
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
||||
@@ -646,7 +646,7 @@ class TransactionDeletionRecord(Document):
|
||||
def validate_doc_status(self):
|
||||
if self.status != "Running":
|
||||
frappe.throw(
|
||||
_("{0} is not running. Cannot trigger events for this Document").format(
|
||||
_("{0} is not running. Cannot trigger events for this document").format(
|
||||
get_link_to_form("Transaction Deletion Record", self.name)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ from frappe import _
|
||||
|
||||
def setup_taxes_and_charges(company_name: str, country: str):
|
||||
if not frappe.db.exists("Company", company_name):
|
||||
frappe.throw(_("Company {} does not exist yet. Taxes setup aborted.").format(company_name))
|
||||
frappe.throw(_("Company {0} does not exist yet. Taxes setup aborted.").format(company_name))
|
||||
|
||||
file_path = os.path.join(os.path.dirname(__file__), "..", "data", "country_wise_tax.json")
|
||||
with open(file_path) as json_file:
|
||||
|
||||
Reference in New Issue
Block a user