Răsfoiți Sursa

use config keys for i18n keys of form item names

utsushiiro 7 ani în urmă
părinte
comite
40ea6c740d

+ 10 - 5
resource/locales/en-US/translation.json

@@ -414,11 +414,6 @@
     },
     "SAML": {
       "name": "SAML",
-      "entry_point": "Entry Point",
-      "issuer": "Issuer",
-      "cert": "Certificate",
-      "First Name": "First Name",
-      "Last Name": "Last Name",
       "id_detail": "Specification of the name of attribute which can identify the user in SAML Identity Provider",
       "username_detail": "Specification of mappings for <code>username</code> when creating new users",
       "mapping_detail": "Specification of mappings for %s when creating new users",
@@ -459,6 +454,16 @@
         "github": "How to configure GitHub OAuth?",
         "twitter": "How to configure Twitter OAuth?"
       }
+    },
+    "form_item_name": {
+      "security:passport-saml:entryPoint": "Entry point",
+      "security:passport-saml:issuer": "Issuer",
+      "security:passport-saml:cert": "Certificate",
+      "security:passport-saml:attrMapId": "ID",
+      "security:passport-saml:attrMapUsername": "Username",
+      "security:passport-saml:attrMapMail": "Mail Address",
+      "security:passport-saml:attrMapFirstName": "First Name",
+      "security:passport-saml:attrMapLastName": "Last Name"
     }
 	},
 

+ 10 - 5
resource/locales/ja/translation.json

@@ -427,11 +427,6 @@
     },
     "SAML": {
       "name": "SAML",
-      "entry_point": "エントリーポイント",
-      "issuer": "発行者",
-      "cert": "証明書",
-      "First Name": "姓",
-      "Last Name": "名",
       "id_detail": "SAML Identity プロバイダ内で一意に識別可能な値を格納している属性",
       "username_detail": "新規ユーザーのアカウント名(<code>username</code>)に関連付ける属性",
       "mapping_detail": "新規ユーザーの%sに関連付ける属性",
@@ -472,6 +467,16 @@
         "github": "GitHub OAuth の設定方法",
         "twitter": "Twitter OAuth の設定方法"
       }
+    },
+    "form_item_name": {
+      "security:passport-saml:entryPoint": "エントリーポイント",
+      "security:passport-saml:issuer": "発行者",
+      "security:passport-saml:cert": "証明書",
+      "security:passport-saml:attrMapId": "ID",
+      "security:passport-saml:attrMapUsername": "ユーザー名",
+      "security:passport-saml:attrMapMail": "メールアドレス",
+      "security:passport-saml:attrMapFirstName": "姓",
+      "security:passport-saml:attrMapLastName": "名"
     }
   },
   "markdown_setting": {

+ 4 - 1
src/server/crowi/express-init.js

@@ -45,7 +45,10 @@ module.exports = function(crowi, app) {
       detection: {
         order: ['userSettingDetector', 'header', 'navigator'],
       },
-      overloadTranslationOptionHandler: i18nSprintf.overloadTranslationOptionHandler
+      overloadTranslationOptionHandler: i18nSprintf.overloadTranslationOptionHandler,
+
+      // change nsSeparator from ':' to '::' because ':' is used in config keys and these are used in i18n keys
+      nsSeparator: '::'
     });
 
   app.use(helmet());

+ 10 - 10
src/server/views/admin/widget/passport/saml.html

@@ -76,7 +76,7 @@
       </thead>
       <tbody>
         <tr>
-          <th>{{ t("security_setting.SAML.entry_point") }}</th>
+          <th>{{ t("security_setting.form_item_name.security:passport-saml:entryPoint") }}</th>
           <td>
             <input class="form-control"
                    type="text"
@@ -97,7 +97,7 @@
           </td>
         </tr>
         <tr>
-          <th>{{ t("security_setting.SAML.issuer") }}</th>
+          <th>{{ t("security_setting.form_item_name.security:passport-saml:issuer") }}</th>
           <td>
             <input class="form-control"
                    type="text"
@@ -118,7 +118,7 @@
           </td>
         </tr>
         <tr>
-          <th>{{ t("security_setting.SAML.cert") }}</th>
+          <th>{{ t("security_setting.form_item_name.security:passport-saml:cert") }}</th>
           <td>
             <textarea class="form-control input-sm"
                       type="text"
@@ -173,7 +173,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
       </thead>
       <tbody>
       <tr>
-        <th>Identifier</th>
+        <th>{{ t("security_setting.form_item_name.security:passport-saml:attrMapId") }}</th>
         <td>
           <input class="form-control"
                  type="text"
@@ -199,7 +199,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
         </td>
       </tr>
       <tr>
-        <th>Username</th>
+        <th>{{ t("security_setting.form_item_name.security:passport-saml:attrMapUsername") }}</th>
         <td>
           <input class="form-control"
                  type="text"
@@ -225,7 +225,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
         </td>
       </tr>
       <tr>
-        <th>Mail</th>
+        <th>{{ t("security_setting.form_item_name.security:passport-saml:attrMapMail") }}</th>
         <td>
           <input class="form-control"
                  type="text"
@@ -250,7 +250,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
         </td>
       </tr>
       <tr>
-        <th>{{ t("security_setting.SAML.First Name") }}</th>
+        <th>{{ t("security_setting.form_item_name.security:passport-saml:attrMapFirstName") }}</th>
         <td>
           <input class="form-control"
                  type="text"
@@ -259,7 +259,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
                  {% if useOnlyEnvVars %}readonly{% endif %}>
           <p class="help-block">
             <small>
-              {{ t("security_setting.SAML.mapping_detail", t("security_setting.SAML.First Name")) }}
+              {{ t("security_setting.SAML.mapping_detail", t("security_setting.form_item_name.security:passport-saml:attrMapFirstName")) }}
             </small>
           </p>
         </td>
@@ -277,7 +277,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
         </td>
       </tr>
       <tr>
-        <th>{{ t("security_setting.SAML.Last Name") }}</th>
+        <th>{{ t("security_setting.form_item_name.security:passport-saml:attrMapLastName") }}</th>
         <td>
           <input class="form-control"
                  type="text"
@@ -286,7 +286,7 @@ pWVdnzS1VCO8fKsJ7YYIr+JmHvseph3kFUOI5RqkCcMZlKUv83aUThsTHw==
                  {% if useOnlyEnvVars %}readonly{% endif %}>
           <p class="help-block">
             <small>
-              {{ t("security_setting.SAML.mapping_detail", t("security_setting.SAML.Last Name")) }}
+              {{ t("security_setting.SAML.mapping_detail", t("security_setting.form_item_name.security:passport-saml:attrMapLastName")) }}
             </small>
           </p>
         </td>