Просмотр исходного кода

Merge pull request #2873 from weseek/imprv/article-area-gw4050

Imprv/article area gw4050
makotoshiraishi 5 лет назад
Родитель
Сommit
cbb33105a8

+ 4 - 0
resource/locales/en_US/translation.json

@@ -156,6 +156,10 @@
     "required": "%s is required",
     "invalid_syntax": "The syntax of %s is invalid."
   },
+  "not_found_page": {
+    "Create Page": "Create Page",
+    "page_not_exist_alert": "This page does not exist. Please create a new page."
+  },
   "installer": {
     "setup": "Setup",
     "create_initial_account": "Create an initial account",

+ 4 - 0
resource/locales/ja_JP/translation.json

@@ -159,6 +159,10 @@
     "required": "%sに値を入力してください",
     "invalid_syntax": "%sの構文が不正です"
   },
+  "not_found_page": {
+    "Create Page": "ページを作成する",
+    "page_not_exist_alert": "このページは存在しません。新たに作成する必要があります。"
+  },
   "installer": {
     "setup": "セットアップ",
     "create_initial_account": "最初のアカウントの作成",

+ 5 - 1
resource/locales/zh_CN/translation.json

@@ -155,7 +155,11 @@
 		"error_message": "有些值不正确",
 		"required": "%s 是必需的",
 		"invalid_syntax": "%s的语法无效。"
-	},
+  },
+  "not_found_page": {
+    "Create Page": "Create Page",
+    "page_not_exist_alert": "This page does not exist. Please create a new page."
+  },
 	"installer": {
 		"setup": "安装",
 		"create_initial_account": "创建初始用户",

+ 6 - 7
src/client/js/components/Page/NotFoundAlert.jsx

@@ -1,8 +1,9 @@
 import React from 'react';
 import PropTypes from 'prop-types';
+import { withTranslation } from 'react-i18next';
 
 const NotFoundAlert = (props) => {
-
+  const { t } = props;
   function clickHandler(viewType) {
     if (props.onPageCreateClicked === null) {
       return;
@@ -15,8 +16,7 @@ const NotFoundAlert = (props) => {
       <div className="col-md-12">
         <h2 className="text-muted not-found-text">
           <i className="icon-info" aria-hidden="true"></i>
-          {/* Todo make the message supported by i18n GW4050 */ }
-          このページは存在しません。新たに作成する必要があります。
+          {t('not_found_page.page_not_exist_alert')}
         </h2>
         <button
           type="button"
@@ -24,8 +24,7 @@ const NotFoundAlert = (props) => {
           onClick={() => { clickHandler('edit') }}
         >
           <i className="icon-note icon-fw" />
-          {/* Todo make the message supported by i18n GW4050 */ }
-          ページを作成する
+          {t('not_found_page.Create Page')}
         </button>
       </div>
     </div>
@@ -34,8 +33,8 @@ const NotFoundAlert = (props) => {
 
 
 NotFoundAlert.propTypes = {
+  t: PropTypes.func.isRequired, // i18next
   onPageCreateClicked: PropTypes.func,
 };
 
-
-export default NotFoundAlert;
+export default withTranslation()(NotFoundAlert);