diff --git a/app/assets/javascripts/admin/templates/user-index.hbs b/app/assets/javascripts/admin/templates/user-index.hbs index baa593a9c0b..9cc35a3dce3 100644 --- a/app/assets/javascripts/admin/templates/user-index.hbs +++ b/app/assets/javascripts/admin/templates/user-index.hbs @@ -175,13 +175,7 @@
{{i18n 'admin.users.active'}}
-
- {{#if model.active}} - {{i18n 'yes_value'}} - {{else}} - {{i18n 'no_value'}} - {{/if}} -
+
{{i18n-yes-no model.active}}
{{#if model.active}} {{#if model.can_deactivate}} @@ -221,7 +215,7 @@
{{i18n 'admin.user.admin'}}
-
{{model.admin}}
+
{{i18n-yes-no model.admin}}
{{#if model.can_revoke_admin}} {{d-button action="revokeAdmin" icon="shield" label="admin.user.revoke_admin"}} @@ -234,7 +228,7 @@
{{i18n 'admin.user.moderator'}}
-
{{model.moderator}}
+
{{i18n-yes-no model.moderator}}
{{#if model.can_revoke_moderation}} {{d-button action="revokeModeration" icon="shield" label="admin.user.revoke_moderation"}} @@ -272,7 +266,7 @@
{{i18n 'admin.user.suspended'}}
-
{{model.isSuspended}}
+
{{i18n-yes-no model.isSuspended}}
{{#if model.isSuspended}} {{d-button class="btn-danger" action="unsuspend" icon="ban" label="admin.user.unsuspend"}} @@ -303,7 +297,7 @@
{{i18n 'admin.user.blocked'}}
-
{{model.blocked}}
+
{{i18n-yes-no model.blocked}}
{{#conditional-loading-spinner size="small" condition=model.blockingUser}} {{#if model.blocked}} @@ -319,7 +313,7 @@
{{i18n 'admin.user.staged'}}
-
{{model.staged}}
+
{{i18n-yes-no model.staged}}
{{i18n 'admin.user.staged_explanation'}}
diff --git a/app/assets/javascripts/discourse-common/helpers/i18n.js.es6 b/app/assets/javascripts/discourse-common/helpers/i18n.js.es6 index 455cc65a355..40fd2893d52 100644 --- a/app/assets/javascripts/discourse-common/helpers/i18n.js.es6 +++ b/app/assets/javascripts/discourse-common/helpers/i18n.js.es6 @@ -1,3 +1,4 @@ import { registerUnbound } from 'discourse-common/lib/helpers'; registerUnbound('i18n', (key, params) => I18n.t(key, params)); +registerUnbound('i18n-yes-no', (value, params) => I18n.t(value ? 'yes_value' : 'no_value', params));