fix(translations): Replace translations by keyword with indexed version (#15426)
* fix(translations): Replace translations by keyword with indexed version
Keywords in the translation also gets translated which
results in an error because python cannot find the key
* Update buying_controller.py
diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py
index ad7d4b2..3671481 100644
--- a/erpnext/controllers/buying_controller.py
+++ b/erpnext/controllers/buying_controller.py
@@ -753,8 +753,11 @@
""".format(item_list, fieldname), as_list=True)]
if invalid_items:
- frappe.throw(_("Following item {items} {verb} marked as {message} item.\
- You can enable them as {message} item from its Item master".format(
- items = ", ".join([d for d in invalid_items]),
- verb = _("are not") if len(invalid_items) > 1 else _("is not"),
- message = message)))
+ items = ", ".join([d for d in invalid_items])
+
+ if len(invalid_items) > 1:
+ error_message = _("Following items {0} are not marked as {1} item. You can enable them as {1} item from its Item master".format(items, message))
+ else:
+ error_message = _("Following item {0} is not marked as {1} item. You can enable them as {1} item from its Item master".format(items, message))
+
+ frappe.throw(error_message)