UX: The "enable 2FA" string was hard to translate
This commit is contained in:
parent
a8079ab679
commit
ce687f334b
|
@ -0,0 +1,18 @@
|
||||||
|
import { default as computed } from 'ember-addons/ember-computed-decorators';
|
||||||
|
|
||||||
|
export default Ember.Component.extend({
|
||||||
|
tagName: 'span',
|
||||||
|
|
||||||
|
@computed("text")
|
||||||
|
translatedText(text) {
|
||||||
|
if (text) return I18n.t(text);
|
||||||
|
},
|
||||||
|
|
||||||
|
click(event) {
|
||||||
|
if (event.target.tagName.toUpperCase() === 'A') {
|
||||||
|
this.sendAction("action", this.get("actionParam"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
|
@ -4,6 +4,7 @@ import { default as computed } from "ember-addons/ember-computed-decorators";
|
||||||
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
|
import PreferencesTabController from "discourse/mixins/preferences-tab-controller";
|
||||||
import { setting } from 'discourse/lib/computed';
|
import { setting } from 'discourse/lib/computed';
|
||||||
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||||
|
import showModal from 'discourse/lib/show-modal';
|
||||||
|
|
||||||
export default Ember.Controller.extend(CanCheckEmails, PreferencesTabController, {
|
export default Ember.Controller.extend(CanCheckEmails, PreferencesTabController, {
|
||||||
|
|
||||||
|
@ -41,11 +42,6 @@ export default Ember.Controller.extend(CanCheckEmails, PreferencesTabController,
|
||||||
return !this.siteSettings.enable_sso && this.siteSettings.enable_local_logins;
|
return !this.siteSettings.enable_sso && this.siteSettings.enable_local_logins;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed
|
|
||||||
showTwoFactorModalText() {
|
|
||||||
return I18n.t('user.second_factor.title').toLowerCase();
|
|
||||||
},
|
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
save() {
|
save() {
|
||||||
this.set('saved', false);
|
this.set('saved', false);
|
||||||
|
@ -105,6 +101,10 @@ export default Ember.Controller.extend(CanCheckEmails, PreferencesTabController,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
bootbox.dialog(message, buttons, {"classes": "delete-account"});
|
bootbox.dialog(message, buttons, {"classes": "delete-account"});
|
||||||
|
},
|
||||||
|
|
||||||
|
showTwoFactorModal() {
|
||||||
|
showModal('second-factor-intro');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,10 +15,6 @@ export default RestrictedUserRoute.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
showTwoFactorModal() {
|
|
||||||
showModal('second-factor-intro');
|
|
||||||
},
|
|
||||||
|
|
||||||
showAvatarSelector() {
|
showAvatarSelector() {
|
||||||
showModal('avatar-selector');
|
showModal('avatar-selector');
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
{{{translatedText}}}
|
|
@ -71,9 +71,7 @@
|
||||||
{{#if model.second_factor_enabled}}
|
{{#if model.second_factor_enabled}}
|
||||||
{{i18n 'user.second_factor.disable'}}
|
{{i18n 'user.second_factor.disable'}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{i18n 'enable'}}
|
{{discourse-linked-text action="showTwoFactorModal" text="user.second_factor.enable"}}
|
||||||
<a href {{action "showTwoFactorModal"}}>{{showTwoFactorModalText}}</a>
|
|
||||||
{{i18n 'user.second_factor.enable'}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if isCurrentUser}}
|
{{#if isCurrentUser}}
|
||||||
|
|
|
@ -741,7 +741,7 @@ en:
|
||||||
second_factor:
|
second_factor:
|
||||||
title: "Two Factor Authentication"
|
title: "Two Factor Authentication"
|
||||||
disable: "Disable two factor authentication"
|
disable: "Disable two factor authentication"
|
||||||
enable: "for enhanced account security"
|
enable: "Enable <a href>two factor authentication</a> for enhanced account security"
|
||||||
confirm_password_description: "Please confirm your password to continue"
|
confirm_password_description: "Please confirm your password to continue"
|
||||||
label: "Code"
|
label: "Code"
|
||||||
enable_description: |
|
enable_description: |
|
||||||
|
|
Loading…
Reference in New Issue