From 0e4d1da087d0fd6cb8742b716358d1af7890d727 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Thu, 25 Jun 2026 16:21:42 +0530 Subject: [PATCH] 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. --- .../import_supplier_invoice/import_supplier_invoice.py | 2 +- erpnext/regional/italy/utils.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py index 436bfafdaf8..b9748750b54 100644 --- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py +++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py @@ -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) diff --git a/erpnext/regional/italy/utils.py b/erpnext/regional/italy/utils.py index b012ae9be69..ce2c7450f70 100644 --- a/erpnext/regional/italy/utils.py +++ b/erpnext/regional/italy/utils.py @@ -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"), )