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
This commit is contained in:
Faris Ansari
2018-09-19 13:13:59 +05:30
committed by Nabin Hait
parent 63a58a6752
commit 2ab6e0e39b
4 changed files with 15 additions and 17 deletions

View File

@@ -753,8 +753,11 @@ def validate_item_type(doc, fieldname, message):
""".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)