Browse Source

Maintenance: Reword source strings used by the two-factor authentication features.

Dusan Vuckovic 1 year ago
parent
commit
c3f92d4495

+ 1 - 0
app/assets/javascripts/app/controllers/_profile/password.coffee

@@ -234,6 +234,7 @@ class ProfilePassword extends App.ControllerSubContent
 
     new App.TwoFactorConfigurationMethodRecoveryCodes(
       container: @el.closest('.content')
+      overrideHeadPrefix: __('Generate recovery codes')
       successCallback: @load
     )
 

+ 4 - 4
app/assets/javascripts/app/controllers/widget/two_factor_configuration/method.coffee

@@ -1,6 +1,6 @@
 class App.TwoFactorConfigurationMethod extends App.Controller
   passwordCheck: true
-  passwordCheckHeadPrefix: null
+  overrideHeadPrefix: null
 
   constructor: (params) ->
     super
@@ -26,11 +26,11 @@ class App.TwoFactorConfigurationMethod extends App.Controller
           )
       )
 
+    if @overrideHeadPrefix
+      modalOptions.overrideHeadPrefix = @overrideHeadPrefix
+
     # Show password check first, if requested.
     if @passwordCheck
-      if @passwordCheckHeadPrefix
-        modalOptions.headPrefix = @passwordCheckHeadPrefix
-
       return new App.TwoFactorConfigurationModalPasswordCheck(
         _.extend(
           {},

+ 0 - 2
app/assets/javascripts/app/controllers/widget/two_factor_configuration/method/recovery_codes.coffee

@@ -1,5 +1,3 @@
 class App.TwoFactorConfigurationMethodRecoveryCodes extends App.TwoFactorConfigurationMethod
-  passwordCheckHeadPrefix: __('Generate recovery codes')
-
   methodModalClass: ->
     App.TwoFactorConfigurationModalRecoveryCodes

+ 8 - 4
app/assets/javascripts/app/controllers/widget/two_factor_configuration/modal.coffee

@@ -7,8 +7,11 @@ class App.TwoFactorConfigurationModal extends App.ControllerModal
   shown: true
   className: 'modal' # no automatic fade transitions
 
-  render: ->
-    super
+  constructor: (params) ->
+    if params.overrideHeadPrefix
+      params.headPrefix = params.overrideHeadPrefix
+
+    super(params)
 
   closeWithFade: =>
     @el.addClass('fade')
@@ -21,8 +24,9 @@ class App.TwoFactorConfigurationModal extends App.ControllerModal
   next: (modalOptions = {}) =>
     @close()
 
-    modalOptions.container ||= @container
-    modalOptions.successCallback ||= @successCallback
+    modalOptions.container          ||= @container
+    modalOptions.overrideHeadPrefix ||= @overrideHeadPrefix
+    modalOptions.successCallback    ||= @successCallback
 
     constructor = modalOptions.nextModalClass || @nextModalClass()
 

+ 1 - 2
app/assets/javascripts/app/controllers/widget/two_factor_configuration/modal/recovery_codes.coffee

@@ -11,8 +11,7 @@ class App.TwoFactorConfigurationModalRecoveryCodes extends App.TwoFactorConfigur
       text: __('Copy')
     }
   ]
-  headPrefix: ''
-  head: __('Generated Recovery Codes')
+  head: __('Save Codes')
   events:
     'click .js-print': 'print'
     'click .js-copy':  'copy'

+ 2 - 2
app/assets/javascripts/app/lib/app_post/two_factor_methods/security_keys.coffee

@@ -3,8 +3,8 @@ App.Config.set('SecurityKeys', {
   identifier:  'SecurityKeys'
   editable:    true
   label:       __('Security Keys')
-  description: __('Complete the sign in with your security key.')
-  helpMessage: __('Complete the sign in with your security key.')
+  description: __('Complete the sign-in with your security key.')
+  helpMessage: __('Complete the sign-in with your security key.')
   icon:        'security-key'
   order:       1000
 }, 'TwoFactorMethods')

+ 1 - 1
app/assets/javascripts/app/views/widget/two_factor_configuration/authenticator_app.jst.eco

@@ -1,4 +1,4 @@
-<div class="main two-factor-auth flex">
+<div class="two-factor-auth flex">
   <p><%= @T('To set up Authenticator App for your account, follow the steps below:') %></p>
   <ol>
     <li>

+ 1 - 1
app/assets/javascripts/app/views/widget/two_factor_configuration/recovery_codes.jst.eco

@@ -1,4 +1,4 @@
-<div class="main two-factor-auth flex">
+<div class="two-factor-auth flex">
   <p><%= @T('Please save your recovery codes listed below somewhere safe. You can use them to sign in if you lose access to another two-factor method:') %></p>
 
   <pre><code readonly><% for elem, i in @recovery_codes: %><%= elem %><% if i == @recovery_codes.length - 1: %><% else if i % 2: %>

+ 2 - 2
app/assets/javascripts/app/views/widget/two_factor_configuration/security_keys/index.jst.eco

@@ -1,3 +1,3 @@
-<p><%= @T('Security keys are hardware devices that can be used as your two-factor authentication method.') %></p>
+<p><%= @T('Security keys are hardware or software credentials that can be used as your two-factor authentication method.') %></p>
 <div class="js-table"></div>
-<p><%= @T('To add a new security key for your account, press the button below.') %></p>
+<p><%= @T('To register a new security key with your account, press the button below.') %></p>

+ 1 - 1
app/frontend/shared/entities/two-factor/plugins/security_keys.ts

@@ -8,7 +8,7 @@ export default {
   name: EnumTwoFactorAuthenticationMethod.SecurityKeys,
   label: __('Security Keys'),
   order: 100,
-  helpMessage: __('Complete sign-in with your hardware security key.'),
+  helpMessage: __('Complete the sign-in with your security key.'),
   errorHelpMessage: __('Try using your security key again.'),
   form: false,
   async setup(

Some files were not shown because too many files changed in this diff