Taichi Masuyama 3 лет назад
Родитель
Сommit
7bd0473c83

+ 6 - 13
packages/app/public/static/locales/en_US/admin.json

@@ -848,6 +848,12 @@
       "log_type": "https://docs.growi.org/en/admin-guide/admin-cookbook/audit-log-setup.html#log-types"
     }
   },
+  "g2g_data_transfer": {
+    "transfer_data_to_another_growi": "Transfer data from this GROWI to another GROWI",
+    "advanced_options": "Advanced options",
+    "start_transfer": "Start transfer",
+    "paste_transfer_key": "Paste transter key here"
+  },
   "plugins": {
     "plugins": "Plugins",
     "plugin_installer": "Plugin Installer",
@@ -1024,19 +1030,6 @@
     "ADMIN_SEARCH_INDICES_NORMALIZE": "Normalize of Elasticsearch indexes",
     "ADMIN_SEARCH_INDICES_REBUILD": "Rebuild Elasticsearch indexes"
   },
-  "g2g_data_transfer": {
-    "tab": "Data transfer",
-    "data_transfer": "Growi To Growi Data Transfer",
-    "transfer_data_to_another_growi": "Transfer data from this GROWI to another GROWI",
-    "transfer_data_to_this_growi": "Transfer data from another GROWI to this GROWI",
-    "advanced_options": "Advanced options",
-    "start_transfer": "Start transfer",
-    "publish_transfer_key": "Publish transfer key",
-    "transfer_key_limit": "Transfer keys are valid for 1 hour after issuance.",
-    "once_transfer_key_used": "Once the transfer key is used for transfer, it cannot be used for any other transfer.",
-    "transfer_to_growi_cloud": "If you wish to transfer to GROWI.cloud, please click here.",
-    "paste_transfer_key": "Paste transter key here"
-  },
   "g2g": {
     "transfer_success": "Completed GROWI to GROWI transfer successfully",
     "error_generate_growi_archive": "Failed to generate GROWI archive file",

+ 10 - 0
packages/app/public/static/locales/en_US/commons.json

@@ -96,5 +96,15 @@
 
   "not_found_page": {
     "page_not_exist": "This page does not exist."
+  },
+
+  "g2g_data_transfer": {
+    "tab": "Data transfer",
+    "data_transfer": "Growi To Growi Data Transfer",
+    "transfer_data_to_this_growi": "Transfer data from another GROWI to this GROWI",
+    "publish_transfer_key": "Publish transfer key",
+    "transfer_key_limit": "Transfer keys are valid for 1 hour after issuance.",
+    "once_transfer_key_used": "Once the transfer key is used for transfer, it cannot be used for any other transfer.",
+    "transfer_to_growi_cloud": "If you wish to transfer to GROWI.cloud, please click here."
   }
 }

+ 0 - 13
packages/app/public/static/locales/en_US/translation.json

@@ -174,19 +174,6 @@
     "failed_to_install": "Failed to install GROWI. Please try again.",
     "failed_to_login_after_install": "Failed to login after installation. Redirecting to the login form ..."
   },
-  "g2g_data_transfer": {
-    "tab": "Data transfer",
-    "data_transfer": "Growi To Growi Data Transfer",
-    "transfer_data_to_another_growi": "Transfer data from this GROWI to another GROWI",
-    "transfer_data_to_this_growi": "Transfer data from another GROWI to this GROWI",
-    "advanced_options": "Advanced options",
-    "start_transfer": "Start transfer",
-    "publish_transfer_key": "Publish transfer key",
-    "transfer_key_limit": "Transfer keys are valid for 1 hour after issuance.",
-    "once_transfer_key_used": "Once the transfer key is used for transfer, it cannot be used for any other transfer.",
-    "transfer_to_growi_cloud": "If you wish to transfer to GROWI.cloud, please click here.",
-    "paste_transfer_key": "Paste transter key here"
-  },
   "breaking_changes": {
     "v346_using_basic_auth": "Basic Authentication currently in use will <strong>no longer be available</strong> in the near future. Remove settings from %s"
   },

+ 6 - 0
packages/app/public/static/locales/ja_JP/admin.json

@@ -856,6 +856,12 @@
       "log_type": "https://docs.growi.org/ja/admin-guide/admin-cookbook/audit-log-setup.html#log-types"
     }
   },
+  "g2g_data_transfer": {
+    "transfer_data_to_another_growi": "このGROWIのデータを別GROWIへ移行する",
+    "advanced_options": "詳細オプション",
+    "start_transfer": "移行を開始する",
+    "paste_transfer_key": "移行キーをここにペースト"
+  },
   "plugins": {
     "plugins": "プラグイン",
     "plugin_installer": "プラグインインストーラー",

+ 10 - 0
packages/app/public/static/locales/ja_JP/commons.json

@@ -96,5 +96,15 @@
 
   "not_found_page": {
     "page_not_exist": "このページは存在しません。"
+  },
+
+  "g2g_data_transfer": {
+    "tab": "データ移行",
+    "data_transfer": "別GROWIとのデータ移行",
+    "transfer_data_to_this_growi": "別GROWIのデータをこのGROWIへ移行する",
+    "publish_transfer_key": "移行キーを発行する",
+    "transfer_key_limit": "※ 移行キーの有効期限は発行から1時間となります。",
+    "once_transfer_key_used": "※ 移行キーは一度移行に利用するとそれ移行はご利用いただけなくなります。",
+    "transfer_to_growi_cloud": "※ GROWI.cloud への移行を実施する場合はこちらをご確認ください。"
   }
 }

+ 0 - 13
packages/app/public/static/locales/ja_JP/translation.json

@@ -176,19 +176,6 @@
     "failed_to_install": "GROWI のインストールに失敗しました。再度お試しください。",
     "failed_to_login_after_install": "インストール後、ログインに失敗しました。ログインフォームに遷移しています ..."
   },
-  "g2g_data_transfer": {
-    "tab": "データ移行",
-    "data_transfer": "別GROWIとのデータ移行",
-    "transfer_data_to_another_growi": "このGROWIのデータを別GROWIへ移行する",
-    "transfer_data_to_this_growi": "別GROWIのデータをこのGROWIへ移行する",
-    "advanced_options": "詳細オプション",
-    "start_transfer": "移行を開始する",
-    "publish_transfer_key": "移行キーを発行する",
-    "transfer_key_limit": "※ 移行キーの有効期限は発行から1時間となります。",
-    "once_transfer_key_used": "※ 移行キーは一度移行に利用するとそれ移行はご利用いただけなくなります。",
-    "transfer_to_growi_cloud": "※ GROWI.cloud への移行を実施する場合はこちらをご確認ください。",
-    "paste_transfer_key": "移行キーをここにペースト"
-  },
   "breaking_changes": {
     "v346_using_basic_auth": "現在利用中の Basic 認証機能は、近い将来<strong>廃止されます</strong>。%s から設定を削除してください。"
   },

+ 6 - 0
packages/app/public/static/locales/zh_CN/admin.json

@@ -856,6 +856,12 @@
       "log_type": "https://docs.growi.org/en/admin-guide/admin-cookbook/audit-log-setup.html#log-types"
     }
   },
+  "g2g_data_transfer": {
+    "transfer_data_to_another_growi": "将数据从这个GROWI迁移到另一个GROWI上",
+    "advanced_options": "高级选项",
+    "start_transfer": "开始迁移",
+    "paste_transfer_key": "在这里粘贴过渡键"
+  },
   "plugins": {
     "plugins": "Plugins",
     "plugin_installer": "Plugin Installer",

+ 10 - 0
packages/app/public/static/locales/zh_CN/commons.json

@@ -96,5 +96,15 @@
 
   "not_found_page": {
     "page_not_exist": "该页面不存在"
+  },
+
+  "g2g_data_transfer": {
+    "tab": "数据迁移",
+    "data_transfer": "与另一个GROWI的数据转移",
+    "transfer_data_to_this_growi": "将数据从另一个GROWI迁移到这个GROWI上",
+    "publish_transfer_key": "发布迁移密钥",
+    "transfer_key_limit": "迁移密钥在签发后一小时内有效。",
+    "once_transfer_key_used": "一旦迁移密钥被用于迁移,它将不再可用于进一步的迁移。",
+    "transfer_to_growi_cloud": "如果您希望迁移到GROWI.cloud,请点击这里。"
   }
 }

+ 0 - 13
packages/app/public/static/locales/zh_CN/translation.json

@@ -182,19 +182,6 @@
     "failed_to_install": "GROWI安装失败。请再试一次。",
     "failed_to_login_after_install": "安装后登录失败。重定向到登录表格..."
 	},
-  "g2g_data_transfer": {
-    "tab": "数据迁移",
-    "data_transfer": "与另一个GROWI的数据转移",
-    "transfer_data_to_another_growi": "将数据从这个GROWI迁移到另一个GROWI上",
-    "transfer_data_to_this_growi": "将数据从另一个GROWI迁移到这个GROWI上",
-    "advanced_options": "高级选项",
-    "start_transfer": "开始迁移",
-    "publish_transfer_key": "发布迁移密钥",
-    "transfer_key_limit": "迁移密钥在签发后一小时内有效。",
-    "once_transfer_key_used": "一旦迁移密钥被用于迁移,它将不再可用于进一步的迁移。",
-    "transfer_to_growi_cloud": "如果您希望迁移到GROWI.cloud,请点击这里。",
-    "paste_transfer_key": "在这里粘贴过渡键"
-  },
 	"breaking_changes": {
 		"v346_using_basic_auth": "当前使用的基本身份验证在不久的将来将不再可用。从%s中删除设置"
 	},

+ 2 - 2
packages/app/src/components/Admin/Common/AdminNavigation.jsx

@@ -12,7 +12,7 @@ import { useGrowiCloudUri, useGrowiAppIdForGrowiCloud } from '../../../stores/co
 // import { withUnstatedContainers } from '../../UnstatedUtils';
 
 const AdminNavigation = (props) => {
-  const { t } = useTranslation('admin');
+  const { t } = useTranslation(['admin', 'commons']);
   // const { appContainer } = props;
   const pathname = window.location.pathname;
 
@@ -36,7 +36,7 @@ const AdminNavigation = (props) => {
       case 'user-groups':              return <><i className="mr-1 icon-fw icon-people"></i>{          t('user_group_management.user_group_management') }</>;
       case 'search':                   return <><i className="mr-1 icon-fw icon-magnifier"></i>{       t('full_text_search_management.full_text_search_management') }</>;
       case 'audit-log':                return <><i className="mr-1 icon-fw icon-feed"></i>{            t('audit_log_management.audit_log')}</>;
-      case 'data-transfer':            return <><i className="mr-1 icon-fw icon-arrow-right"></i>{     t('g2g_data_transfer.data_transfer')}</>;
+      case 'data-transfer':            return <><i className="mr-1 icon-fw icon-arrow-right"></i>{     t('g2g_data_transfer.data_transfer', { ns: 'commons' })}</>;
       case 'plugins':                  return <><i className="mr-1 icon-fw icon-puzzle"></i>{          t('plugins.plugins')}</>;
       case 'cloud':                    return <><i className="mr-1 icon-fw icon-share-alt"></i>{       t('cloud_setting_management.to_cloud_settings')} </>;
       default:                         return <><i className="mr-1 icon-fw icon-home"></i>{            t('wiki_management_home_page') }</>;

+ 7 - 7
packages/app/src/components/Admin/G2GDataTransfer.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useState } from 'react';
 
-import { useTranslation } from 'react-i18next';
+import { useTranslation } from 'next-i18next';
 
 import { useGenerateTransferKey } from '~/client/services/g2g-transfer';
 import { toastError, toastSuccess } from '~/client/util/apiNotification';
@@ -19,7 +19,7 @@ const IGNORED_COLLECTION_NAMES = [
 
 const G2GDataTransfer = (): JSX.Element => {
   const { data: socket } = useAdminSocket();
-  const { t } = useTranslation();
+  const { t } = useTranslation(['admin', 'commons']);
 
   const [startTransferKey, setStartTransferKey] = useState('');
   const [collections, setCollections] = useState<string[]>([]);
@@ -164,12 +164,12 @@ const G2GDataTransfer = (): JSX.Element => {
         </div>
       )}
 
-      <h2 className="border-bottom mt-5">{t('admin:g2g_data_transfer.transfer_data_to_this_growi')}</h2>
+      <h2 className="border-bottom mt-5">{t('commons:g2g_data_transfer.transfer_data_to_this_growi')}</h2>
 
       <div className="form-group row mt-4">
         <div className="col-md-3">
           <button type="button" className="btn btn-primary w-100" onClick={onClickHandler}>
-            {t('admin:g2g_data_transfer.publish_transfer_key')}
+            {t('commons:g2g_data_transfer.publish_transfer_key')}
           </button>
         </div>
         <div className="col-md-9">
@@ -181,9 +181,9 @@ const G2GDataTransfer = (): JSX.Element => {
       </div>
 
       <div className="alert alert-warning mt-4">
-        <p className="mb-1">{t('admin:g2g_data_transfer.transfer_key_limit')}</p>
-        <p className="mb-1">{t('admin:g2g_data_transfer.once_transfer_key_used')}</p>
-        <p className="mb-0">{t('admin:g2g_data_transfer.transfer_to_growi_cloud')}</p>
+        <p className="mb-1">{t('commons:g2g_data_transfer.transfer_key_limit')}</p>
+        <p className="mb-1">{t('commons:g2g_data_transfer.once_transfer_key_used')}</p>
+        <p className="mb-0">{t('commons:g2g_data_transfer.transfer_to_growi_cloud')}</p>
       </div>
     </div>
   );

+ 2 - 2
packages/app/src/components/DataTransferForm.tsx

@@ -1,13 +1,13 @@
 import React from 'react';
 
-import { useTranslation } from 'react-i18next';
+import { useTranslation } from 'next-i18next';
 
 import { useGenerateTransferKey } from '~/client/services/g2g-transfer';
 
 import CustomCopyToClipBoard from './Common/CustomCopyToClipBoard';
 
 const DataTransferForm = (): JSX.Element => {
-  const { t } = useTranslation();
+  const { t } = useTranslation('commons');
   const { transferKey, generateTransferKey } = useGenerateTransferKey();
 
   return (

+ 1 - 1
packages/app/src/pages/admin/data-transfer.page.tsx

@@ -18,7 +18,7 @@ type Props = CommonProps;
 
 
 const DataTransferPage: NextPage<Props> = (props) => {
-  const { t } = useTranslation('admin');
+  const { t } = useTranslation('commons');
   useCurrentUser(props.currentUser ?? null);
 
   const title = t('g2g_data_transfer.data_transfer');