Browse Source

feat: admin auth translations (wip)

Nick 6 years ago
parent
commit
71673479e2
1 changed files with 16 additions and 17 deletions
  1. 16 17
      client/components/admin/admin-auth.vue

+ 16 - 17
client/components/admin/admin-auth.vue

@@ -5,8 +5,8 @@
         .admin-header
         .admin-header
           img.animated.fadeInUp(src='/svg/icon-unlock.svg', alt='Authentication', style='width: 80px;')
           img.animated.fadeInUp(src='/svg/icon-unlock.svg', alt='Authentication', style='width: 80px;')
           .admin-header-title
           .admin-header-title
-            .headline.primary--text.animated.fadeInLeft Authentication
-            .subheading.grey--text.animated.fadeInLeft.wait-p4s Configure the authentication settings of your wiki
+            .headline.primary--text.animated.fadeInLeft {{ $t('admin:auth.title') }}
+            .subheading.grey--text.animated.fadeInLeft.wait-p4s {{ $t('admin:auth.subtitle') }}
           v-spacer
           v-spacer
           v-btn.animated.fadeInDown.wait-p2s(outline, color='grey', @click='refresh', large)
           v-btn.animated.fadeInDown.wait-p2s(outline, color='grey', @click='refresh', large)
             v-icon refresh
             v-icon refresh
@@ -17,7 +17,7 @@
       v-flex(lg3, xs12)
       v-flex(lg3, xs12)
         v-card.animated.fadeInUp
         v-card.animated.fadeInUp
           v-toolbar(flat, color='primary', dark, dense)
           v-toolbar(flat, color='primary', dark, dense)
-            .subheading Strategies
+            .subheading {{$t('admin:auth.strategies')}}
           v-list(two-line, dense).py-0
           v-list(two-line, dense).py-0
             template(v-for='(str, idx) in strategies')
             template(v-for='(str, idx) in strategies')
               v-list-tile(:key='str.key', @click='selectedStrategy = str.key', :disabled='!str.isAvailable')
               v-list-tile(:key='str.key', @click='selectedStrategy = str.key', :disabled='!str.isAvailable')
@@ -35,30 +35,30 @@
 
 
         v-card.wiki-form.mt-3.animated.fadeInUp.wait-p2s
         v-card.wiki-form.mt-3.animated.fadeInUp.wait-p2s
           v-toolbar(flat, color='primary', dark, dense)
           v-toolbar(flat, color='primary', dark, dense)
-            .subheading Global Advanced settings
+            .subheading {{$t('admin:auth.globalAdvSettings')}}
           v-card-text
           v-card-text
             v-text-field.md2(
             v-text-field.md2(
               v-model='jwtAudience'
               v-model='jwtAudience'
               outline
               outline
               prepend-icon='account_balance'
               prepend-icon='account_balance'
-              label='JWT Audience'
-              hint='Audience URN used in JWT issued upon login. Usually your domain name. (e.g. urn:your.domain.com)'
+              :label='$t(`admin:auth.jwtAudience`)'
+              :hint='$t(`admin:auth.jwtAudienceHint`)'
               persistent-hint
               persistent-hint
             )
             )
             v-text-field.mt-3.md2(
             v-text-field.mt-3.md2(
               v-model='jwtExpiration'
               v-model='jwtExpiration'
               outline
               outline
               prepend-icon='schedule'
               prepend-icon='schedule'
-              label='Token Expiration'
-              hint='The expiration period of a token until it must be renewed. (default: 30m)'
+              :label='$t(`admin:auth.tokenExpiration`)'
+              :hint='$t(`admin:auth.tokenExpirationHint`)'
               persistent-hint
               persistent-hint
             )
             )
             v-text-field.mt-3.md2(
             v-text-field.mt-3.md2(
               v-model='jwtRenewablePeriod'
               v-model='jwtRenewablePeriod'
               outline
               outline
               prepend-icon='update'
               prepend-icon='update'
-              label='Token Renewal Period'
-              hint='The maximum period a token can be renewed when expired. (default: 14d)'
+              :label='$t(`admin:auth.tokenRenewalPeriod`)'
+              :hint='$t(`admin:auth.tokenRenewalPeriodHint`)'
               persistent-hint
               persistent-hint
             )
             )
 
 
@@ -73,13 +73,12 @@
                 img(:src='strategy.logo', :alt='strategy.title')
                 img(:src='strategy.logo', :alt='strategy.title')
               .caption.pt-3 {{strategy.description}}
               .caption.pt-3 {{strategy.description}}
               .caption.pb-3: a(:href='strategy.website') {{strategy.website}}
               .caption.pb-3: a(:href='strategy.website') {{strategy.website}}
-              .body-2(v-if='strategy.isEnabled')
-                span This strategy is
-                v-chip(color='green', small, dark, label) active
-                span(v-if='selectedStrategy === `local`') and cannot be disabled.
-              .body-2(v-else)
-                span This strategy is
-                v-chip(color='red', small, dark, label) not active
+              i18next.body-2(path='admin:auth.strategyState', tag='div', v-if='strategy.isEnabled')
+                v-chip(color='green', small, dark, label, place='state') {{$t('admin:auth.strategyStateActive')}}
+                span(v-if='selectedStrategy === `local`', place='locked') {{$t('admin:auth.strategyStateLocked')}}
+                span(v-else, place='locked', v-text='')
+              i18next.body-2(path='admin:auth.strategyState', tag='div', v-else)
+                v-chip(color='red', small, dark, label, place='state') {{$t('admin:auth.strategyStateInactive')}}
               v-divider.mt-3
               v-divider.mt-3
               v-subheader.pl-0 Strategy Configuration
               v-subheader.pl-0 Strategy Configuration
               .body-1.ml-3(v-if='!strategy.config || strategy.config.length < 1'): em This strategy has no configuration options you can modify.
               .body-1.ml-3(v-if='!strategy.config || strategy.config.length < 1'): em This strategy has no configuration options you can modify.