fix: translated strings
This commit is contained in:
parent
47e59753dd
commit
70ca45c293
4 changed files with 20 additions and 18 deletions
|
|
@ -58,8 +58,8 @@ class Comment(Document):
|
|||
recipients = [frappe.db.get_value("User", {"enabled": 1, "name": name, "user_type": "System User", "allowed_in_mentions": 1}, "email")
|
||||
for name in mentions]
|
||||
|
||||
notification_message = _('''<b>{0}</b> mentioned you in a comment in <b>{1} {2}</b></span>''')\
|
||||
.format(sender_fullname, self.reference_doctype, title)
|
||||
notification_message = _('''{0} mentioned you in a comment in {1} {2}''')\
|
||||
.format(frappe.bold(sender_fullname), frappe.bold(self.reference_doctype), frappe.bold(title))
|
||||
|
||||
notification_doc = {
|
||||
'type': 'Mention',
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ def notify_assignment(assigned_by, owner, doc_type, doc_name, action='CLOSE',
|
|||
description_html = "<p>{0}</p>".format(description) if description else None
|
||||
|
||||
if action=='CLOSE':
|
||||
subject = _('<b>Your</b> assignment on <b>{0} {1}</b> has been removed').format(doc_type, title)
|
||||
subject = _('Your assignment on {0} {1} has been removed').format(frappe.bold(doc_type), frappe.bold(title))
|
||||
else:
|
||||
subject = '''<b>{0}</b> assigned a new task <b>{1} {2}</b> to you'''.format(user_name, doc_type, title)
|
||||
|
||||
|
|
|
|||
|
|
@ -157,7 +157,8 @@ def notify_assignment(shared_by, doctype, doc_name, everyone, description=None,
|
|||
frappe.db.get_value(doctype, doc_name, title_field)
|
||||
|
||||
reference_user = get_fullname(frappe.session.user)
|
||||
notification_message = _('''<b>{0}</b> shared a document <b>{1} {2}</b> with you''').format(reference_user, doctype, title)
|
||||
notification_message = _('''{0} shared a document {1} {2} with you''')\
|
||||
.format(frappe.bold(reference_user), frappe.bold(doctype), frappe.bold(title))
|
||||
notification_doc = {
|
||||
'type': 'Share',
|
||||
'reference_doctype': doctype,
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ class EnergyPointLog(Document):
|
|||
'type': 'Energy Point',
|
||||
'reference_doctype': self.reference_doctype,
|
||||
'reference_name': self.reference_name,
|
||||
'subject': get_notifications_message(self),
|
||||
'subject': get_notification_message(self),
|
||||
'reference_user': reference_user
|
||||
}
|
||||
|
||||
create_notification(self.user, notification_doc, self.reason)
|
||||
|
||||
def get_notifications_message(doc):
|
||||
def get_notification_message(doc):
|
||||
owner_name = get_fullname(doc.owner)
|
||||
points = doc.points
|
||||
title_field = frappe.get_meta(doc.reference_doctype).get_title_field()
|
||||
|
|
@ -50,30 +50,31 @@ def get_notifications_message(doc):
|
|||
frappe.db.get_value(doc.reference_doctype, doc.reference_name, title_field)
|
||||
|
||||
if doc.type == 'Auto':
|
||||
owner_name = frappe.bold('You')
|
||||
if points == 1:
|
||||
message = _('<b>You</b> gained <b>{0}</b> point for {1} <b>{2}</b>')
|
||||
message = _('{0} gained {1} point for {2} {3}')
|
||||
else:
|
||||
message = _('<b>You</b> gained <b>{0}</b> points for {1} <b>{2}</b>')
|
||||
message = message.format(points, doc.rule, title)
|
||||
message = _('{0} gained {1} points for {2} {3}')
|
||||
message = message.format(owner_name, frappe.bold(points), doc.rule, frappe.bold(title))
|
||||
elif doc.type == 'Appreciation':
|
||||
if points == 1:
|
||||
message = _('<b>{0}</b> appreciated your work on <b>{1}</b> with <b>{2}</b> point')
|
||||
message = _('{0} appreciated your work on {1} with {2} point')
|
||||
else:
|
||||
message = _('<b>{0}</b> appreciated your work on <b>{1}</b> with <b>{2}</b> points')
|
||||
message = message.format(owner_name, title, points)
|
||||
message = _('{0} appreciated your work on {1} with {2} points')
|
||||
message = message.format(frappe.bold(owner_name), frappe.bold(title), frappe.bold(points))
|
||||
elif doc.type == 'Criticism':
|
||||
if points == 1:
|
||||
message = _('<b>{0}</b> criticized your work on <b>{1}</b> with <b>{2}</b> point')
|
||||
message = _('{0} criticized your work on {1} with {2} point')
|
||||
else:
|
||||
message = _('<b>{0}</b> criticized your work on <b>{1}</b> with <b>{2}</b> points')
|
||||
message = _('{0} criticized your work on {1} with {2} points')
|
||||
|
||||
message = message.format(owner_name, title, points)
|
||||
message = message.format(frappe.bold(owner_name), frappe.bold(title), frappe.bold(points))
|
||||
elif doc.type == 'Revert':
|
||||
if points == 1:
|
||||
message = _('<b>{0}</b> reverted your point on <b>{1}</b>')
|
||||
message = _('{0} reverted your point on {1}')
|
||||
else:
|
||||
message = _('<b>{0}</b> reverted your points on <b>{1}</b>')
|
||||
message = message.format(owner_name, title)
|
||||
message = _('{0} reverted your points on {1}')
|
||||
message = message.format(frappe.bold(owner_name), frappe.bold(title))
|
||||
|
||||
return message
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue