chore: rewrite user-facing messages in Regional 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:21:42 +05:30
parent 7124e47490
commit 0e4d1da087
2 changed files with 5 additions and 5 deletions

View File

@@ -85,7 +85,7 @@ class ImportSupplierInvoice(Document):
}
if not invoices_args.get("bill_no", ""):
frappe.throw(_("Numero has not set in the XML file"))
frappe.throw(_("Numero has not been set in the XML file"))
supp_dict = get_supplier_details(file_content)
invoices_args["destination_code"] = get_destination_code_from_file(file_content)

View File

@@ -224,7 +224,7 @@ def sales_invoice_validate(doc):
if not doc.company_address:
frappe.throw(
_("Please set an Address on the Company '%s'" % doc.company),
_("Please set an Address on the Company '{0}'").format(doc.company),
title=_("E-Invoicing Information Missing"),
)
else:
@@ -254,7 +254,7 @@ def sales_invoice_validate(doc):
doc.customer_fiscal_code = customer.fiscal_code
if not doc.customer_fiscal_code:
frappe.throw(
_("Please set Fiscal Code for the customer '%s'" % doc.customer),
_("Please set Fiscal Code for the customer '{0}'").format(doc.customer),
title=_("E-Invoicing Information Missing"),
)
else:
@@ -262,14 +262,14 @@ def sales_invoice_validate(doc):
doc.customer_fiscal_code = customer.fiscal_code
if not doc.customer_fiscal_code:
frappe.throw(
_("Please set Fiscal Code for the public administration '%s'" % doc.customer),
_("Please set Fiscal Code for the public administration '{0}'").format(doc.customer),
title=_("E-Invoicing Information Missing"),
)
else:
doc.tax_id = customer.tax_id
if not doc.tax_id:
frappe.throw(
_("Please set Tax ID for the customer '%s'" % doc.customer),
_("Please set Tax ID for the customer '{0}'").format(doc.customer),
title=_("E-Invoicing Information Missing"),
)