You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/07/21 08:26:54 UTC

[GitHub] [incubator-apisix-dashboard] TikWind opened a new pull request #327: i18n route

TikWind opened a new pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327


   i18n route


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] TikWind commented on pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
TikWind commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-663464260


   > Please have a look at those existing comments, once all PRs are merged, I will do a release.
   
   I have test, maybe you can merge, and then I have one more pr about menu.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #327: WIP: i18n route

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#discussion_r459281760



##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,14 +1,12 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
-import { useIntl } from 'umi';
+import { formatMessage } from 'umi';

Review comment:
       Nope




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-664077648


   
   Any updates?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #327: WIP: i18n route

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#discussion_r459377204



##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,13 +1,16 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
-import { formatMessage } from 'umi';
+import { useIntl } from 'umi';
 
 type Props = {
   onReset?(): void;
 };
 
-const ResultView: React.FC<Props> = () => (
+const ResultView: React.FC<Props> = () => {

Review comment:
       ```
   const ResultView: React.FC<Props> = () => {
     const { formatMessage } = useIntl();
     return (
       <Result
        xx
       />
     )
   }
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-663361152


   Not sure why you did a force push 😂😂


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on pull request #327: WIP: i18n route

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-662764035


   @LiteSun Please take a look at this PR.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-663361397


   Please have a look at those existing comments, once all PRs are merged, I will do a release.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #327: WIP: i18n route

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#discussion_r459156368



##########
File path: src/pages/Route/components/CreateStep4/CreateStep4.tsx
##########
@@ -17,15 +18,18 @@ const style = {
 };
 
 const CreateStep4: React.FC<Props> = ({ form1, form2, redirect, ...rest }) => {
+
+  const { formatMessage } = useIntl();
+
   return (
     <>
-      <h2>定义 API 请求</h2>
+      <h2>{formatMessage({ id: 'route.create.define.api.request' })}</h2>
       <Step1 {...rest} form={form1} disabled />
       {!redirect && (
         <>
-          <h2 style={style}>定义 API 后端服务</h2>
+          <h2 style={style}>{formatMessage({ id: 'route.create.define.api.backend.server' })}</h2>

Review comment:
       Same here

##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,21 +1,24 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
+import { useIntl } from 'umi';
 
 type Props = {
   onReset?(): void;
 };
 
+const { formatMessage } = useIntl();
+
 const ResultView: React.FC<Props> = () => (
   <Result
     status="success"
-    title="提交成功"
+    title={formatMessage({ id: 'route.result.submit.success' })}

Review comment:
       global.submit.success

##########
File path: src/pages/Route/List.tsx
##########
@@ -60,22 +62,22 @@ const Page: React.FC = () => {
             onClick={() => history.push(`/routes/${record.id}/edit`)}
             style={{ marginRight: 10 }}
           >
-            编辑
+            {formatMessage({ id: 'route.list.edit' })}
           </Button>
           <Popconfirm
-            title="确定删除该路由吗?"
+            title={formatMessage({ id: 'route.list.delete.confrim' })}
             onConfirm={() => {
               remove(record.id!).then(() => {
-                notification.success({ message: '删除记录成功' });
+                notification.success({ message: formatMessage({ id: 'route.list.delete.success' }) });
                 /* eslint-disable no-unused-expressions */
                 ref.current?.reload();
               });
             }}
-            okText="确定"
-            cancelText="取消"
+            okText={formatMessage({ id: 'route.list.confirm' })}

Review comment:
       Not a good key, we could use global.confirm.ok and global.confirm.cancel instead.

##########
File path: src/pages/Route/List.tsx
##########
@@ -93,7 +95,7 @@ const Page: React.FC = () => {
         request={(params) => fetchList(params, search)}
         toolBarRender={(action) => [
           <Input.Search
-            placeholder="请输入"
+            placeholder={formatMessage({ id: 'route.list,input' })}

Review comment:
       Please note the extra comma 

##########
File path: src/pages/Route/List.tsx
##########
@@ -42,16 +44,16 @@ const Page: React.FC = () => {
     //   dataIndex: 'priority',
     // },
     {
-      title: '描述',
+      title: formatMessage({ id: 'route.list.description' }),
       dataIndex: 'description',
     },
     {
-      title: '更新时间',
+      title: formatMessage({ id: 'route.list.edit.time' }),

Review comment:
       Also, we could use global.updatedAt instead of current key.

##########
File path: src/pages/Route/components/CreateStep4/CreateStep4.tsx
##########
@@ -17,15 +18,18 @@ const style = {
 };
 
 const CreateStep4: React.FC<Props> = ({ form1, form2, redirect, ...rest }) => {
+
+  const { formatMessage } = useIntl();
+
   return (
     <>
-      <h2>定义 API 请求</h2>
+      <h2>{formatMessage({ id: 'route.create.define.api.request' })}</h2>

Review comment:
       Do not need the long key, we could use some words here, e.g route.create.defineAPIRequest

##########
File path: src/pages/Route/List.tsx
##########
@@ -42,16 +44,16 @@ const Page: React.FC = () => {
     //   dataIndex: 'priority',
     // },
     {
-      title: '描述',
+      title: formatMessage({ id: 'route.list.description' }),
       dataIndex: 'description',
     },
     {
-      title: '更新时间',
+      title: formatMessage({ id: 'route.list.edit.time' }),

Review comment:
       .updatedAt would be better

##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,21 +1,24 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
+import { useIntl } from 'umi';
 
 type Props = {
   onReset?(): void;
 };
 
+const { formatMessage } = useIntl();
+
 const ResultView: React.FC<Props> = () => (
   <Result
     status="success"
-    title="提交成功"
+    title={formatMessage({ id: 'route.result.submit.success' })}
     extra={[
       <Button type="primary" key="goto-list" onClick={() => history.replace('/routes/list')}>
-        返回路由列表
+        {formatMessage({ id: 'route.result.return.list' })}

Review comment:
       global.back




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #327: WIP: i18n route

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#discussion_r459281951



##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,14 +1,12 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
-import { useIntl } from 'umi';
+import { formatMessage } from 'umi';

Review comment:
       Use useIntl please




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#discussion_r460009251



##########
File path: src/pages/Route/components/ResultView/ResultView.tsx
##########
@@ -1,24 +1,31 @@
 import React from 'react';
 import { Result, Button } from 'antd';
 import { history } from 'umi';
+import { useIntl } from 'umi';

Review comment:
       ,




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-apisix-dashboard] TikWind commented on pull request #327: feat(i18n): route module

Posted by GitBox <gi...@apache.org>.
TikWind commented on pull request #327:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/327#issuecomment-664077929


   > Any updates?
   
   I am doing this, wait a moment.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org