Fix the translator not being used properly in the notifications (#20)

* Fix the translator not being used properly

* fix weird indentation thing
This commit is contained in:
David Sevilla Martín 2018-07-20 19:23:19 -04:00 committed by Toby Zerner
parent 99a4d91bdd
commit ea28537b76
2 changed files with 4 additions and 6 deletions

View File

@ -13,12 +13,11 @@ export default class UserSuspendedNotification extends Notification {
content() {
const notification = this.props.notification;
const actor = notification.sender();
const suspendUntil = notification.content();
const timeReadable = moment(suspendUntil.date).from(notification.time(), true);
return app.translator.transChoice('flarum-suspend.forum.notifications.user_suspended_text', {
actor,
return app.translator.trans('flarum-suspend.forum.notifications.user_suspended_text', {
user: notification.sender(),
timeReadable,
});
}

View File

@ -13,10 +13,9 @@ export default class UserUnsuspendedNotification extends Notification {
content() {
const notification = this.props.notification;
const actor = notification.sender();
return app.translator.transChoice('flarum-suspend.forum.notifications.user_unsuspended_text', {
actor,
return app.translator.trans('flarum-suspend.forum.notifications.user_unsuspended_text', {
user: notification.sender(),
});
}
}