diff --git a/rhodecode/model/notification.py b/rhodecode/model/notification.py --- a/rhodecode/model/notification.py +++ b/rhodecode/model/notification.py @@ -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) diff --git a/rhodecode/templates/admin/my_account/my_account_notifications.mako b/rhodecode/templates/admin/my_account/my_account_notifications.mako --- a/rhodecode/templates/admin/my_account/my_account_notifications.mako +++ b/rhodecode/templates/admin/my_account/my_account_notifications.mako @@ -53,7 +53,6 @@
- diff --git a/rhodecode/translation.py b/rhodecode/translation.py --- a/rhodecode/translation.py +++ b/rhodecode/translation.py @@ -16,7 +16,7 @@ # RhodeCode Enterprise Edition, including its added features, Support services, # and proprietary license terms, please see https://rhodecode.com/licenses/ -from pyramid.i18n import TranslationStringFactory +from pyramid.i18n import TranslationStringFactory, TranslationString # Create a translation string factory for the 'rhodecode' domain. _ = TranslationStringFactory('rhodecode')