fix: translatability of boldened text

This commit is contained in:
barredterra 2024-08-16 20:58:55 +02:00 committed by Akhil Narang
parent 3da56632d7
commit daa6c617d4
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F
4 changed files with 13 additions and 8 deletions

View file

@ -51,7 +51,9 @@ class AssignmentRule(Document):
def validate_document_types(self):
if self.document_type == "ToDo":
frappe.throw(_("Assignment Rule is not allowed on {0} document type").format(frappe.bold("ToDo")))
frappe.throw(
_("Assignment Rule is not allowed on document type {0}").format(frappe.bold(_("ToDo")))
)
def validate_assignment_days(self):
assignment_days = self.get_assignment_days()

View file

@ -122,7 +122,9 @@ class AutoRepeat(Document):
def validate_submit_on_creation(self):
if self.submit_on_creation and not frappe.get_meta(self.reference_doctype).is_submittable:
frappe.throw(
_("Cannot enable {0} for a non-submittable doctype").format(frappe.bold("Submit on Creation"))
_("Cannot enable {0} for a non-submittable doctype").format(
frappe.bold(_("Submit on Creation"))
)
)
def validate_dates(self):
@ -134,7 +136,9 @@ class AutoRepeat(Document):
if self.end_date == self.start_date:
frappe.throw(
_("{0} should not be same as {1}").format(frappe.bold("End Date"), frappe.bold("Start Date"))
_("{0} should not be same as {1}").format(
frappe.bold(_("End Date")), frappe.bold(_("Start Date"))
)
)
def validate_email_id(self):

View file

@ -128,7 +128,7 @@ class Contact(Document):
return
if len([email.email_id for email in self.email_ids if email.is_primary]) > 1:
frappe.throw(_("Only one {0} can be set as primary.").format(frappe.bold("Email ID")))
frappe.throw(_("Only one {0} can be set as primary.").format(frappe.bold(_("Email ID"))))
if len(self.email_ids) == 1:
self.email_ids[0].is_primary = 1

View file

@ -115,12 +115,11 @@ def get_notification_message(doc):
title = get_title(doc.reference_doctype, doc.reference_name)
if doc.type == "Auto":
owner_name = frappe.bold("You")
if points == 1:
message = _("{0} gained {1} point for {2} {3}")
message = _("You gained {1} point for {2} {3}")
else:
message = _("{0} gained {1} points for {2} {3}")
message = message.format(owner_name, frappe.bold(points), doc.rule, get_title_html(title))
message = _("You gained {1} points for {2} {3}")
message = message.format(frappe.bold(points), doc.rule, get_title_html(title))
elif doc.type == "Appreciation":
if points == 1:
message = _("{0} appreciated your work on {1} with {2} point")