Переглянути джерело

Added localization for Slack Integration Page

Steven Fukase 5 роки тому
батько
коміт
a390c448f7

+ 8 - 2
resource/locales/en_US/admin/admin.json

@@ -253,8 +253,14 @@
     "delete": "Delete"
   },
   "slack_integration": {
-    "access_token": "Access Token",
-    "custom_button_non_proxy_settings": "Custom bot (non-proxy) Settings"
+    "access_token_settings": {
+      "discard": "Discard",
+      "generate": "Generate"
+    },
+    "custom_bot_non_proxy_settings": "Custom bot (non-proxy) Settings",
+    "non_proxy": {
+      "create_bot": "Create Bot"
+    }
   },
   "user_management": {
     "invite_users": "Invite new users",

+ 8 - 2
resource/locales/ja_JP/admin/admin.json

@@ -251,8 +251,14 @@
     "Directory_hierarchy_tag": "ディレクトリ階層タグ"
   },
   "slack_integration": {
-    "access_token": "アクセストークン",
-    "custom_button_non_proxy_settings": "Custom bot (non-proxy) 設定"
+    "access_token_settings": {
+      "discard": "破棄",
+      "generate": "発行"
+    },
+    "custom_bot_non_proxy_settings": "Custom bot (non-proxy) 設定",
+    "non_proxy": {
+      "create_bot": "Bot を作成する"
+    }
   },
   "user_management": {
     "invite_users": "新規ユーザーの招待",

+ 8 - 2
resource/locales/zh_CN/admin/admin.json

@@ -261,8 +261,14 @@
 		"delete": "删除"
   },
   "slack_integration": {
-    "access_token": "Access token",
-    "custom_button_non_proxy_settings": "Custom bot (non-proxy) 设置"
+    "access_token_settings": {
+      "discard": "丢弃",
+      "generate": "生成"
+    },
+    "custom_bot_non_proxy_settings": "Custom bot (non-proxy) 设置",
+    "non_proxy": {
+      "create_bot": "创建 Bot"
+    }
   },
 	"user_management": {
 		"invite_users": "邀请新用户",

+ 0 - 1
src/client/js/components/Admin/Common/AdminUpdateButtonRow.jsx

@@ -16,7 +16,6 @@ const AdminUpdateButtonRow = (props) => {
 
 AdminUpdateButtonRow.propTypes = {
   t: PropTypes.func.isRequired, // i18next
-
   onClick: PropTypes.func.isRequired,
   disabled: PropTypes.bool.isRequired,
 };

+ 11 - 4
src/client/js/components/Admin/SlackIntegration/AccessTokenSettings.jsx

@@ -1,4 +1,6 @@
 import React, { Fragment } from 'react';
+import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
 
 class AccessTokenSettings extends React.Component {
 
@@ -11,10 +13,11 @@ class AccessTokenSettings extends React.Component {
   }
 
   render() {
+    const { t } = this.props;
+
     return (
       <Fragment>
         <div className="form-group row my-5">
-          {/* <label className="text-left text-md-right col-md-3 col-form-label">{t('admin:app_setting.site_name')}</label> */}
           <label className="text-left text-md-right col-md-3 col-form-label">Access Token</label>
           <div className="col-md-6">
             <input className="form-control" type="text" placeholder="access-token" />
@@ -24,10 +27,10 @@ class AccessTokenSettings extends React.Component {
         <div className="row">
           <div className="mx-auto">
             <button type="button" className="btn btn-outline-secondary text-nowrap mx-1" onClick={this.discardHandler}>
-              Discard
+              {t('admin:slack_integration.access_token_settings.discard')}
             </button>
             <button type="button" className="btn btn-primary text-nowrap mx-1" onClick={this.updateHandler}>
-              Generate
+              {t('admin:slack_integration.access_token_settings.generate')}
             </button>
           </div>
         </div>
@@ -37,4 +40,8 @@ class AccessTokenSettings extends React.Component {
 
 }
 
-export default AccessTokenSettings;
+AccessTokenSettings.propTypes = {
+  t: PropTypes.func.isRequired, // i18next
+};
+
+export default withTranslation()(AccessTokenSettings);

+ 11 - 13
src/client/js/components/Admin/SlackIntegration/CustomBotNonProxySettings.jsx

@@ -1,5 +1,7 @@
 import React, { Fragment } from 'react';
-// import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
+import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
+import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
 class CustomBotNonProxySettings extends React.Component {
 
@@ -17,19 +19,19 @@ class CustomBotNonProxySettings extends React.Component {
   }
 
   render() {
+    const { t } = this.props;
 
     return (
       <Fragment>
         <div className="row my-5">
           <div className="mx-auto">
             <button type="button" className="btn btn-primary text-nowrap mx-1" onClick={() => window.open('https://api.slack.com/apps', '_blank')}>
-              Create Bot
+              {t('admin:slack_integration.non_proxy.create_bot')}
             </button>
           </div>
         </div>
 
         <div className="form-group row">
-          {/* <label className="text-left text-md-right col-md-3 col-form-label">{t('admin:app_setting.site_name')}</label> */}
           <label className="text-left text-md-right col-md-3 col-form-label">Signing Secret</label>
           <div className="col-md-6">
             <input
@@ -41,7 +43,6 @@ class CustomBotNonProxySettings extends React.Component {
         </div>
 
         <div className="form-group row mb-5">
-          {/* <label className="text-left text-md-right col-md-3 col-form-label">{t('admin:app_setting.site_name')}</label> */}
           <label className="text-left text-md-right col-md-3 col-form-label">Bot User OAuth Token</label>
           <div className="col-md-6">
             <input
@@ -52,18 +53,15 @@ class CustomBotNonProxySettings extends React.Component {
           </div>
         </div>
 
-        {/* <AdminUpdateButtonRow /> */}
-        <div className="row">
-          <div className="mx-auto">
-            <button type="button" className="btn btn-primary text-nowrap mx-1" onClick={this.updateHandler}>
-              Update
-            </button>
-          </div>
-        </div>
+        <AdminUpdateButtonRow onClick={this.updateHandler} disabled={false} />
       </Fragment>
     );
   }
 
 }
 
-export default CustomBotNonProxySettings;
+CustomBotNonProxySettings.propTypes = {
+  t: PropTypes.func.isRequired, // i18next
+};
+
+export default withTranslation()(CustomBotNonProxySettings);

+ 2 - 2
src/client/js/components/Admin/SlackIntegration/SlackIntegration.jsx

@@ -15,14 +15,14 @@ class SlackIntegration extends React.Component {
       <Fragment>
         <div className="row">
           <div className="col-lg-12">
-            <h2 className="admin-setting-header">{t('admin:slack_integration.access_token')}</h2>
+            <h2 className="admin-setting-header">Access Token</h2>
             <AccessTokenSettings />
           </div>
         </div>
 
         <div className="row">
           <div className="col-lg-12">
-            <h2 className="admin-setting-header">{t('admin:slack_integration.custom_button_non_proxy_settings')}</h2>
+            <h2 className="admin-setting-header">{t('admin:slack_integration.custom_bot_non_proxy_settings')}</h2>
             <CustomBotNonProxySettings />
           </div>
         </div>