notifications: fixed translation problem in my notifications.
This commit is contained in:
parent
9464700f9b
commit
2ec1d828e5
3 changed files with 6 additions and 2 deletions
|
|
@ -38,6 +38,7 @@ from rhodecode.model import BaseModel
|
|||
from rhodecode.model.db import Notification, User, UserNotification
|
||||
from rhodecode.model.meta import Session
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
from rhodecode.translation import TranslationString
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -275,6 +276,10 @@ class NotificationModel(BaseModel):
|
|||
date_or_age = h.age(notification.created_on)
|
||||
if translate:
|
||||
date_or_age = translate(date_or_age)
|
||||
|
||||
if isinstance(date_or_age, TranslationString):
|
||||
date_or_age = date_or_age.interpolate()
|
||||
|
||||
else:
|
||||
template = templates[1]
|
||||
date_or_age = h.format_date(notification.created_on)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue