From ea28537b76d2d3b2538eb912d82ef6b6f65ef786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sevilla=20Mart=C3=ADn?= Date: Fri, 20 Jul 2018 19:23:19 -0400 Subject: [PATCH] Fix the translator not being used properly in the notifications (#20) * Fix the translator not being used properly * fix weird indentation thing --- .../js/src/forum/components/UserSuspendedNotification.js | 5 ++--- .../js/src/forum/components/UserUnsuspendedNotification.js | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/extensions/suspend/js/src/forum/components/UserSuspendedNotification.js b/extensions/suspend/js/src/forum/components/UserSuspendedNotification.js index 008c83b7d..8333bc428 100644 --- a/extensions/suspend/js/src/forum/components/UserSuspendedNotification.js +++ b/extensions/suspend/js/src/forum/components/UserSuspendedNotification.js @@ -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, }); } diff --git a/extensions/suspend/js/src/forum/components/UserUnsuspendedNotification.js b/extensions/suspend/js/src/forum/components/UserUnsuspendedNotification.js index 3a92009c6..01ef72ab3 100644 --- a/extensions/suspend/js/src/forum/components/UserUnsuspendedNotification.js +++ b/extensions/suspend/js/src/forum/components/UserUnsuspendedNotification.js @@ -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(), }); } }