Futa Arai 2 лет назад
Родитель
Сommit
f8d05c5f1e

+ 7 - 1
apps/app/public/static/locales/en_US/admin.json

@@ -1039,6 +1039,8 @@
   },
   "external_group": {
     "management": "External Group Management",
+    "execute_sync": "Execute Sync",
+    "sync": "Sync",
     "ldap": {
       "group_sync_settings": "LDAP Group Sync Settings",
       "group_search_base_DN": "Group Search Base DN",
@@ -1053,7 +1055,11 @@
       "preserve_deleted_ldap_groups": "Preserve Deleted LDAP Groups",
       "name_mapper_detail": "Attribute to map as group name",
       "description_mapper_detail": "Attribute to map as group description. Description can be edited after sync. However, when a mapper is set, the edited value can possibly be overwritten by the next sync.",
-      "updated_group_sync_settings": "Updated LDAP group sync settings"
+      "updated_group_sync_settings": "Updated LDAP group sync settings",
+      "sync_succeeded": "Sync succeeded",
+      "sync_failed": "Sync failed. Check LDAP security settings and group sync settings",
+      "password": "Password",
+      "password_detail": "Login password is necessary because Bind type is set to User Bind"
     }
   },
   "toaster": {

+ 7 - 1
apps/app/public/static/locales/ja_JP/admin.json

@@ -1047,6 +1047,8 @@
   },
   "external_group": {
     "management": "外部グループ管理",
+    "execute_sync": "同期実行",
+    "sync": "同期",
     "ldap": {
       "group_sync_settings": "LDAP グループ同期設定",
       "group_search_base_DN": "グループ検索ベース DN",
@@ -1061,7 +1063,11 @@
       "preserve_deleted_ldap_groups": "LDAP から削除されたグループを GROWI に残す",
       "name_mapper_detail": "グループの「名前」として読み込む属性",
       "description_mapper_detail": "グループの「説明」として読み込む属性。「説明」は同期後に編集可能です。ただし、mapper が設定されている場合、編集内容は再同期によって上書きされます。",
-      "updated_group_sync_settings": "LDAP グループ同期設定を更新しました"
+      "updated_group_sync_settings": "LDAP グループ同期設定を更新しました",
+      "sync_succeeded": "同期に成功しました",
+      "sync_failed": "同期に失敗しました。LDAP セキュリティ設定や、グループ同期設定が正しいことを確認してください。",
+      "password": "パスワード",
+      "password_detail": "認証設定がユーザ Bind のため、ログイン時のパスワードの入力が必要となります"
     }
   },
   "toaster": {

+ 7 - 1
apps/app/public/static/locales/zh_CN/admin.json

@@ -1047,6 +1047,8 @@
   },
   "external_group": {
     "management": "External Group Management",
+    "execute_sync": "Execute Sync",
+    "sync": "Sync",
     "ldap": {
       "group_sync_settings": "LDAP Group Sync Settings",
       "group_search_base_DN": "Group Search Base DN",
@@ -1061,7 +1063,11 @@
       "preserve_deleted_ldap_groups": "Preserve Deleted LDAP Groups",
       "name_mapper_detail": "Attribute to map as group name",
       "description_mapper_detail": "Attribute to map as group description. Description can be edited after sync. However, when a mapper is set, the edited value can possibly be overwritten by the next sync.",
-      "updated_sync_settings": "Updated LDAP group sync settings"
+      "updated_group_sync_settings": "Updated LDAP group sync settings",
+      "sync_succeeded": "Group sync succeeded",
+      "sync_failed": "Sync failed. Check LDAP security settings and group sync settings",
+      "password": "Password",
+      "password_detail": "Login password is necessary because Bind type is set to User Bind"
     }
   },
   "toaster": {

+ 10 - 7
apps/app/src/components/Admin/UserGroup/ExternalGroup/LdapGroupManagement.tsx

@@ -2,6 +2,8 @@ import {
   FC, useCallback, useEffect, useState,
 } from 'react';
 
+import { useTranslation } from 'react-i18next';
+
 import { apiv3Get, apiv3Put } from '~/client/util/apiv3-client';
 import { toastError, toastSuccess } from '~/client/util/toastr';
 
@@ -9,6 +11,7 @@ import { LdapGroupSyncSettingsForm } from './LdapGroupSyncSettingsForm';
 
 export const LdapGroupManagement: FC = () => {
   const [isUserBind, setIsUserBind] = useState(false);
+  const { t } = useTranslation('admin');
 
   useEffect(() => {
     const getIsUserBind = async() => {
@@ -29,19 +32,19 @@ export const LdapGroupManagement: FC = () => {
     const password = e.target.password.value;
     try {
       await apiv3Put('/external-user-groups/ldap/sync', { password });
-      toastSuccess('同期に成功しました');
+      toastSuccess(t('external_group.ldap.sync_succeeded'));
     }
     catch (e) {
-      toastError('同期に失敗しました。LDAP による認証設定や、グループ同期設定が正しいことを確認してください。');
+      toastError(t('external_group.ldap.sync_failed'));
     }
-  }, []);
+  }, [t]);
 
   return <>
     <LdapGroupSyncSettingsForm />
-    <h3 className="border-bottom mb-3">同期実行</h3>
+    <h3 className="border-bottom mb-3">{t('external_group.execute_sync')}</h3>
     <form onSubmit={onSyncBtnClick}>
       {isUserBind && <div className="row form-group">
-        <label htmlFor="ldapGroupSyncPassword" className="text-left text-md-right col-md-3 col-form-label">パスワード</label>
+        <label htmlFor="ldapGroupSyncPassword" className="text-left text-md-right col-md-3 col-form-label">{t('external_group.ldap.password')}</label>
         <div className="col-md-6">
           <input
             className="form-control"
@@ -50,13 +53,13 @@ export const LdapGroupManagement: FC = () => {
             id="ldapGroupSyncPassword"
           />
           <p className="form-text text-muted">
-            <small>認証設定がユーザBind のため、ログイン時のパスワードの入力が必要となります。</small>
+            <small>{t('external_group.ldap.password_detail')}</small>
           </p>
         </div>
       </div>}
       <div className="row">
         <div className="col-md-3"></div>
-        <div className="col-md-6"><button className="btn btn-primary" type="submit">同期</button></div>
+        <div className="col-md-6"><button className="btn btn-primary" type="submit">{t('external_group.sync')}</button></div>
       </div>
     </form>
   </>;