##// END OF EJS Templates
fixed way of creating notification template for better translations
marcink -
r2993:716550e1 beta
parent child Browse files
Show More
@@ -217,16 +217,16 b' class NotificationModel(BaseModel):'
217 #alias
217 #alias
218 _n = notification
218 _n = notification
219 _map = {
219 _map = {
220 _n.TYPE_CHANGESET_COMMENT: _('commented on commit'),
220 _n.TYPE_CHANGESET_COMMENT: _('commented on commit at %(when)s'),
221 _n.TYPE_MESSAGE: _('sent message'),
221 _n.TYPE_MESSAGE: _('sent message at %(when)s'),
222 _n.TYPE_MENTION: _('mentioned you'),
222 _n.TYPE_MENTION: _('mentioned you at %(when)s'),
223 _n.TYPE_REGISTRATION: _('registered in RhodeCode'),
223 _n.TYPE_REGISTRATION: _('registered in RhodeCode at %(when)s'),
224 _n.TYPE_PULL_REQUEST: _('opened new pull request'),
224 _n.TYPE_PULL_REQUEST: _('opened new pull request at %(when)s'),
225 _n.TYPE_PULL_REQUEST_COMMENT: _('commented on pull request')
225 _n.TYPE_PULL_REQUEST_COMMENT: _('commented on pull request at %(when)s')
226 }
226 }
227
227
228 # action == _map string
228 # action == _map string
229 tmpl = "%(user)s %(action)s at %(when)s"
229 tmpl = "%(user)s %(action)s "
230 if show_age:
230 if show_age:
231 when = h.age(notification.created_on)
231 when = h.age(notification.created_on)
232 else:
232 else:
@@ -234,9 +234,9 b' class NotificationModel(BaseModel):'
234
234
235 data = dict(
235 data = dict(
236 user=notification.created_by_user.username,
236 user=notification.created_by_user.username,
237 action=_map[notification.type_], when=when,
237 action=_map[notification.type_]
238 )
238 )
239 return tmpl % data
239 return (tmpl % data) % {'when': when}
240
240
241
241
242 class EmailNotificationModel(BaseModel):
242 class EmailNotificationModel(BaseModel):
General Comments 0
You need to be logged in to leave comments. Login now