Browse Source

i18n GrowiZipImportConfigurationModal

Yuki Takei 6 years ago
parent
commit
37514d440c

+ 26 - 0
resource/locales/en-US/translation.json

@@ -763,6 +763,32 @@
         "at_least_one": "Select one or more collections.",
         "page_and_revision": "'Pages' and 'Revisions' must be imported both.",
         "depends": "'{{target}}' must be selected when '{{condition}}' is selected."
+      },
+      "configuration": {
+        "pages": {
+          "overwrite_author": {
+            "label": "Overwrite page's author with the current user",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          },
+          "set_public_to_page": {
+            "label": "Set 'Public' to the pages that is '{{from}}'",
+            "desc": "Make sure that this configuration makes all <b>'{{from}}'</b> pages readable from <span class=\"text-danger\">ANY</span> users."
+          },
+          "initialize_meta_datas": {
+            "label": "Initialize page's like, read users and comment count",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          },
+          "initialize_hackmd_related_datas": {
+            "label": "Initialize HackMD related data",
+            "desc": "Recommended to check this unless there is important drafts on HackMD."
+          }
+        },
+        "revisions": {
+          "overwrite_author": {
+            "label": "Overwrite revision's author with the current user",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          }
+        }
       }
     },
     "esa_settings": {

+ 26 - 0
resource/locales/ja/translation.json

@@ -748,6 +748,32 @@
         "at_least_one": "コレクションが選択されていません",
         "page_and_revision": "'Pages' と 'Revisions' はセットでインポートする必要があります",
         "depends": "'{{condition}}' をインポートする場合は、'{{target}}' を一緒に選択する必要があります"
+      },
+      "configuration": {
+        "pages": {
+          "overwrite_author": {
+            "label": "Overwrite page's author with the current user",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          },
+          "set_public_to_page": {
+            "label": "Set 'Public' to the pages that is '{{from}}'",
+            "desc": "Make sure that this configuration makes all <b>'{{from}}'</b> pages readable from <span class=\"text-danger\">ANY</span> users."
+          },
+          "initialize_meta_datas": {
+            "label": "Initialize page's like, read users and comment count",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          },
+          "initialize_hackmd_related_datas": {
+            "label": "Initialize HackMD related data",
+            "desc": "Recommended to check this unless there is important drafts on HackMD."
+          }
+        },
+        "revisions": {
+          "overwrite_author": {
+            "label": "Overwrite revision's author with the current user",
+            "desc": "Recommended <span class=\"text-danger\">NOT</span> to check this when users will also be restored."
+          }
+        }
       }
     },
     "esa_settings": {

+ 22 - 20
src/client/js/components/Admin/ImportData/GrowiZipImportConfigurationModal.jsx

@@ -1,3 +1,5 @@
+/* eslint-disable react/no-danger */
+
 import React from 'react';
 import PropTypes from 'prop-types';
 import { withTranslation } from 'react-i18next';
@@ -52,8 +54,11 @@ class GrowiZipImportConfigurationModal extends React.Component {
   }
 
   renderPagesContents() {
+    const { t } = this.props;
     const { option } = this.state;
 
+    const translationBase = 'importer_management.growi_settings.configuration.pages';
+
     /* eslint-disable react/no-unescaped-entities */
     return (
       <>
@@ -65,8 +70,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ isOverwriteAuthorWithCurrentUser: !option.isOverwriteAuthorWithCurrentUser })}
           />
           <label htmlFor="cbOpt4">
-            Overwrite page's author with the current user
-            <p className="help-block mt-0">Recommended <span className="text-danger">NOT</span> to check this when users will also be restored.</p>
+            {t(`${translationBase}.overwrite_author.label`)}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.overwrite_author.desc`) }} />
           </label>
         </div>
         <div className="checkbox checkbox-warning">
@@ -77,10 +82,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ makePublicForGrant2: !option.makePublicForGrant2 })}
           />
           <label htmlFor="cbOpt1">
-            Set 'Public' to the pages that is 'Anyone with the link'
-            <p className="help-block mt-0">
-              Make sure that this configuration makes all 'Anyone with the link' pages readable from <span className="text-danger">ANY</span> users.<br />
-            </p>
+            {t(`${translationBase}.set_public_to_page.label`, { from: 'Anyone with the link' })}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.set_public_to_page.desc`, { from: 'Anyone with the link' }) }} />
           </label>
         </div>
         <div className="checkbox checkbox-warning">
@@ -91,10 +94,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ makePublicForGrant4: !option.makePublicForGrant4 })}
           />
           <label htmlFor="cbOpt2">
-            Set 'Public' to the pages that is 'Just me'
-            <p className="help-block mt-0">
-              Make sure that this configuration makes all 'Just me' pages readable from <span className="text-danger">ANY</span> users.<br />
-            </p>
+            {t(`${translationBase}.set_public_to_page.label`, { from: 'Just me' })}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.set_public_to_page.desc`, { from: 'Just me' }) }} />
           </label>
         </div>
         <div className="checkbox checkbox-warning">
@@ -105,10 +106,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ makePublicForGrant5: !option.makePublicForGrant5 })}
           />
           <label htmlFor="cbOpt3">
-            Set 'Public' to the pages that is 'Only inside the group'
-            <p className="help-block mt-0">
-              Make sure that this configuration makes all 'Only inside the group' pages readable from <span className="text-danger">ANY</span> users.<br />
-            </p>
+            {t(`${translationBase}.set_public_to_page.label`, { from: 'Only inside the group' })}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.set_public_to_page.desc`, { from: 'Only inside the group' }) }} />
           </label>
         </div>
         <div className="checkbox checkbox-default">
@@ -119,8 +118,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ initPageMetadatas: !option.initPageMetadatas })}
           />
           <label htmlFor="cbOpt5">
-            Initialize page's like, read users and comment count
-            <p className="help-block mt-0">Recommended <span className="text-danger">NOT</span> to check this when users will also be restored.</p>
+            {t(`${translationBase}.initialize_meta_datas.label`)}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.initialize_meta_datas.desc`) }} />
           </label>
         </div>
         <div className="checkbox checkbox-default">
@@ -131,8 +130,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ initHackmdDatas: !option.initHackmdDatas })}
           />
           <label htmlFor="cbOpt6">
-            Initialize HackMD related data
-            <p className="help-block mt-0">Recommended to check this unless there is important drafts on HackMD.</p>
+            {t(`${translationBase}.initialize_hackmd_related_datas.label`)}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.initialize_hackmd_related_datas.desc`) }} />
           </label>
         </div>
       </>
@@ -141,8 +140,11 @@ class GrowiZipImportConfigurationModal extends React.Component {
   }
 
   renderRevisionsContents() {
+    const { t } = this.props;
     const { option } = this.state;
 
+    const translationBase = 'importer_management.growi_settings.configuration.revisions';
+
     /* eslint-disable react/no-unescaped-entities */
     return (
       <>
@@ -154,8 +156,8 @@ class GrowiZipImportConfigurationModal extends React.Component {
             onChange={() => this.changeHandler({ isOverwriteAuthorWithCurrentUser: !option.isOverwriteAuthorWithCurrentUser })}
           />
           <label htmlFor="cbOpt1">
-            Overwrite page's author with the current user
-            <p className="help-block mt-0">Recommended <span className="text-danger">NOT</span> to check this when users will also be restored.</p>
+            {t(`${translationBase}.overwrite_author.label`)}
+            <p className="help-block mt-0" dangerouslySetInnerHTML={{ __html: t(`${translationBase}.overwrite_author.desc`) }} />
           </label>
         </div>
       </>