Przeglądaj źródła

refs 114888: questionnaire i18n

Futa Arai 3 lat temu
rodzic
commit
193d71d370

+ 11 - 1
packages/app/public/static/locales/en_US/admin.json

@@ -387,7 +387,17 @@
     "enable": "Enable",
     "enable": "Enable",
     "disable": "Disable",
     "disable": "Disable",
     "use_env_var_if_empty": "If the value in the database is empty, the value of the environment variable <code>{{variable}}</code> is used.",
     "use_env_var_if_empty": "If the value in the database is empty, the value of the environment variable <code>{{variable}}</code> is used.",
-    "note_for_the_only_env_option": "The GCS Settings is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> ."
+    "note_for_the_only_env_option": "The GCS Settings is limited by the value of environment variable.<br>To change this setting, please change to false or delete the value of the environment variable <code>{{env}}</code> .",
+    "questionnaire_settings": "Questionnaire settings",
+    "questionnaire_settings_explanation": "This will enable/disable questionnaires on the whole system. Users can also enable/disable questionnaires individually from personal settings page.",
+    "about_data_sent": "About information sent",
+    "docs_link": "https://docs.growi.org/en/admin-guide/management-cookbook/app-settings.html#questionnaire-settings",
+    "learn_more": "Learn more",
+    "other_info_will_be_sent": "Along with the questionnaire answer, information necessary to improve GROWI will be sent. Personal user info will not be included in the data sent.",
+    "we_will_use_the_data_to_improve_growi": "We will use the data to improve GROWI experience as much as possible.",
+    "anonymize_app_site_url": "Anonymize app site URL in data sent",
+    "url_anonymization_explanation": "The app site URL included in the questionnaire answer will be anonymized. By enabling this, the GROWI application that sends the questionnaire answer will not be identified.",
+    "enable_questionnaire": "Enable questionnaire"
   },
   },
   "markdown_settings": {
   "markdown_settings": {
     "markdown_settings": "Markdown Settings",
     "markdown_settings": "Markdown Settings",

+ 11 - 1
packages/app/public/static/locales/ja_JP/admin.json

@@ -395,7 +395,17 @@
     "enable": "有効",
     "enable": "有効",
     "disable": "無効",
     "disable": "無効",
     "use_env_var_if_empty": "データベース側の値が空の場合、環境変数 <code>{{variable}}</code> の値を利用します",
     "use_env_var_if_empty": "データベース側の値が空の場合、環境変数 <code>{{variable}}</code> の値を利用します",
-    "note_for_the_only_env_option": "現在GCS設定は環境変数の値によって制限されています<br>この設定を変更する場合は環境変数 <code>{{env}}</code> の値をfalseに変更もしくは削除してください"
+    "note_for_the_only_env_option": "現在GCS設定は環境変数の値によって制限されています<br>この設定を変更する場合は環境変数 <code>{{env}}</code> の値をfalseに変更もしくは削除してください",
+    "questionnaire_settings": "アンケート設定",
+    "questionnaire_settings_explanation": "システム全体でアンケート機能を有効/無効にします。また、ユーザーは設定画面から個別にアンケート機能を有効/無効にできます。",
+    "about_data_sent": "送信される情報について",
+    "docs_link": "https://docs.growi.org/ja/admin-guide/management-cookbook/app-settings.html#%E3%82%A2%E3%83%B3%E3%82%B1%E3%83%BC%E3%83%88%E8%A8%AD%E5%AE%9A",
+    "learn_more": "詳細",
+    "other_info_will_be_sent": "アンケートの回答と合わせて、GROWI の改善に必要な情報を収集します。収集されるデータにユーザーの個人情報は含まれません。",
+    "we_will_use_the_data_to_improve_growi": "私たちはそれらを活用し、最大限ユーザーの体験を向上させるよう努めます。",
+    "anonymize_app_site_url": "サイト URL を匿名化して送信する",
+    "url_anonymization_explanation": "アンケート回答データに含まれるサイト URL が匿名化されます。この設定を有効にすることで、アンケート回答データの送信元である GROWI アプリケーションが特定されなくなります。",
+    "enable_questionnaire": "アンケートを有効にする"
   },
   },
   "markdown_settings": {
   "markdown_settings": {
     "markdown_settings": "マークダウン設定",
     "markdown_settings": "マークダウン設定",

+ 2 - 2
packages/app/src/components/Admin/App/AppSettingsPageContents.tsx

@@ -14,9 +14,9 @@ import AppSetting from './AppSetting';
 import FileUploadSetting from './FileUploadSetting';
 import FileUploadSetting from './FileUploadSetting';
 import MailSetting from './MailSetting';
 import MailSetting from './MailSetting';
 import { MaintenanceMode } from './MaintenanceMode';
 import { MaintenanceMode } from './MaintenanceMode';
+import QuestionnaireSettings from './QuestionnaireSettings';
 import SiteUrlSetting from './SiteUrlSetting';
 import SiteUrlSetting from './SiteUrlSetting';
 import V5PageMigration from './V5PageMigration';
 import V5PageMigration from './V5PageMigration';
-import QuestionnaireSettings from './QuestionnaireSettings';
 
 
 
 
 const logger = loggerFactory('growi:appSettings');
 const logger = loggerFactory('growi:appSettings');
@@ -110,7 +110,7 @@ const AppSettingsPageContents = (props: Props) => {
 
 
       <div className="row mt-5">
       <div className="row mt-5">
         <div className="col-lg-12">
         <div className="col-lg-12">
-          <h2 className="admin-setting-header">アンケート設定</h2>
+          <h2 className="admin-setting-header">{t('admin:app_setting.questionnaire_settings')}</h2>
           <QuestionnaireSettings />
           <QuestionnaireSettings />
         </div>
         </div>
       </div>
       </div>

+ 12 - 16
packages/app/src/components/Admin/App/QuestionnaireSettings.tsx

@@ -7,15 +7,11 @@ import { useTranslation } from 'next-i18next';
 import { toastSuccess, toastError } from '~/client/util/apiNotification';
 import { toastSuccess, toastError } from '~/client/util/apiNotification';
 import { apiv3Put } from '~/client/util/apiv3-client';
 import { apiv3Put } from '~/client/util/apiv3-client';
 import { useSWRxAppSettings } from '~/stores/admin/app-settings';
 import { useSWRxAppSettings } from '~/stores/admin/app-settings';
-import loggerFactory from '~/utils/logger';
 
 
 import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 import AdminUpdateButtonRow from '../Common/AdminUpdateButtonRow';
 
 
-const logger = loggerFactory('growi:questionnaireSettings');
-
 const QuestionnaireSettings = (): JSX.Element => {
 const QuestionnaireSettings = (): JSX.Element => {
-  // TODO: i18n
-  const { t } = useTranslation();
+  const { t } = useTranslation(['admin', 'commons']);
 
 
   const { data, error, mutate } = useSWRxAppSettings();
   const { data, error, mutate } = useSWRxAppSettings();
 
 
@@ -35,7 +31,7 @@ const QuestionnaireSettings = (): JSX.Element => {
         isQuestionnaireEnabled,
         isQuestionnaireEnabled,
         isAppSiteUrlHashed,
         isAppSiteUrlHashed,
       });
       });
-      toastSuccess(t('toaster.update_successed', { target: 'アンケート設定', ns: 'commons' }));
+      toastSuccess(t('commons:toaster.update_successed', { target: t('admin:app_setting.questionnaire_settings') }));
     }
     }
     catch (err) {
     catch (err) {
       toastError(err);
       toastError(err);
@@ -54,17 +50,17 @@ const QuestionnaireSettings = (): JSX.Element => {
   return (
   return (
     <div id="questionnaire-settings" className="mb-5">
     <div id="questionnaire-settings" className="mb-5">
       <p className="card well">
       <p className="card well">
-        システム全体でアンケート機能を有効/無効にします。また、ユーザーは設定画面から個別にアンケート機能を有効/無効にできます。
+        {t('admin:app_setting.questionnaire_settings_explanation')}
         <br />
         <br />
         <br />
         <br />
         <span>
         <span>
-          <span className="text-info mr-2"><i className="icon-info icon-fw"></i>送信される情報について</span>
-          {/* eslint-disable-next-line max-len */}
-          <a href="https://docs.growi.org/ja/admin-guide/management-cookbook/app-settings.html#%E3%82%A2%E3%83%B3%E3%82%B1%E3%83%BC%E3%83%88%E8%A8%AD%E5%AE%9A" rel="noreferrer" target="_blank" className="d-inline">詳細<i className="icon-share-alt"></i></a>
+          <span className="text-info mr-2"><i className="icon-info icon-fw"></i>{t('admin:app_setting.about_data_sent')}</span>
+          <a href={t('admin:app_setting.docs_link')} rel="noreferrer" target="_blank" className="d-inline">
+            {t('admin:app_setting.learn_more')} <i className="icon-share-alt"></i>
+          </a>
           <br />
           <br />
-          アンケートの回答と合わせて、GROWI の改善に必要な最小限の情報を合わせて収集します。<br />
-          収集されるデータにユーザーの個人情報は含まれません。<br />
-          私たちはそれらを活用し、最大限ユーザーの体験を向上させるよう努めます。
+          {t('admin:app_setting.other_info_will_be_sent')}<br />
+          {t('admin:app_setting.we_will_use_the_data_to_improve_growi')}
         </span>
         </span>
       </p>
       </p>
 
 
@@ -84,7 +80,7 @@ const QuestionnaireSettings = (): JSX.Element => {
                 onChange={onChangeIsQuestionnaireEnabledHandler}
                 onChange={onChangeIsQuestionnaireEnabledHandler}
               />
               />
               <label className="custom-control-label" htmlFor="isQuestionnaireEnabled">
               <label className="custom-control-label" htmlFor="isQuestionnaireEnabled">
-                アンケートを有効にする
+                {t('admin:app_setting.enable_questionnaire')}
               </label>
               </label>
             </div>
             </div>
           </div>
           </div>
@@ -100,10 +96,10 @@ const QuestionnaireSettings = (): JSX.Element => {
                 disabled={!isQuestionnaireEnabled}
                 disabled={!isQuestionnaireEnabled}
               />
               />
               <label className="custom-control-label" htmlFor="isAppSiteUrlHashed">
               <label className="custom-control-label" htmlFor="isAppSiteUrlHashed">
-                サイト URL を匿名化して送信する
+                {t('admin:app_setting.anonymize_app_site_url')}
               </label>
               </label>
               <p className="form-text text-muted small">
               <p className="form-text text-muted small">
-                アンケート回答データに含まれるサイト URL が匿名化されます。この設定を有効にすることで、アンケート回答データの送信元である GROWI アプリケーションが特定されなくなります。
+                {t('admin:app_setting.url_anonymization_explanation')}
               </p>
               </p>
             </div>
             </div>
           </div>
           </div>