Przeglądaj źródła

deploy页面的翻译OK

Csy817 7 lat temu
rodzic
commit
953b24b67b

+ 16 - 16
src/app/common/deploy/tencent/APIGroupCard.js

@@ -12,7 +12,7 @@ const Panel = Collapse.Panel;
 // 如需添加中文,请在此处 value 处添加
 // eg: 'xxxx': <F..  id='xxx'/>
 const valueToKey = {
-    'groupName': 'Name',
+    'groupName': 'groupName',
     'environmentName': 'environmentName',
     'defaultDomain': 'defaultDomain',
     'frontType': 'frontType',
@@ -189,7 +189,7 @@ class APIGroupCard extends Component {
         return (
             <div>
                 <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['groupName']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['groupName']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['groupName']}>
                                     <Icon type="question-circle"/>
@@ -200,7 +200,7 @@ class APIGroupCard extends Component {
                 </div>
 
                 <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['region']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['region']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['region']}>
                                     <Icon type="question-circle"/>
@@ -211,15 +211,15 @@ class APIGroupCard extends Component {
                         // onChange={this.switchConfig('groupRegion')}
                         this.props.switchRegion(e);
                     }} value={removePrefix('ap-', this.state.groupRegion)} buttonStyle="solid">
-                        <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
-                        <Radio.Button value="shanghai">Shanghai</Radio.Button>
-                        <Radio.Button value="beijing">Beijing</Radio.Button>
-                        <Radio.Button value="chengdu">Chengdu</Radio.Button>
+                        <Radio.Button value="guangzhou"><FormattedMessage id="Guangzhou"/></Radio.Button>
+                        <Radio.Button value="shanghai"><FormattedMessage id="Shanghai"/></Radio.Button>
+                        <Radio.Button value="beijing"><FormattedMessage id="Beijing"/></Radio.Button>
+                        <Radio.Button value="chengdu"><FormattedMessage id="Chengdu"/></Radio.Button>
                     </Radio.Group>
                 </div>
 
                 <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['environmentName']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['environmentName']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['environmentName']}>
                                     <Icon type="question-circle"/>
@@ -227,16 +227,16 @@ class APIGroupCard extends Component {
                             </span>
                     <Radio.Group onChange={this.switchConfig('environmentName')} defaultValue={this.state.environmentName}
                                  buttonStyle="solid">
-                        <Radio.Button value="test">test</Radio.Button>
-                        <Radio.Button value="prepub">prepub</Radio.Button>
-                        <Radio.Button value="release">release</Radio.Button>
+                        <Radio.Button value="test"><FormattedMessage id="test"/></Radio.Button>
+                        <Radio.Button value="prepub"><FormattedMessage id="prepub"/></Radio.Button>
+                        <Radio.Button value="release"><FormattedMessage id="release"/></Radio.Button>
                     </Radio.Group>
                 </div>
                 <Collapse bordered={false}>
-                    <Panel header="Want more options?" style={customPanelStyle}>
+                    <Panel header=<FormattedMessage id="Want more options?"/> style={customPanelStyle}>
 
                         <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['frontType']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['frontType']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['frontType']}>
                                     <Icon type="question-circle"/>
@@ -260,7 +260,7 @@ class APIGroupCard extends Component {
                         {/*</div>*/}
 
                         <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['userDomain']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['userDomain']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['userDomain']}>
                                     <Icon type="question-circle"/>
@@ -291,7 +291,7 @@ class APIGroupCard extends Component {
                                 const id = idGen('group');
                                 this.ok(id);
                                 this.props.pass(id, 'group');
-                            }} type='primary'>save</Button>
+                            }} type='primary'><FormattedMessage id="save"/></Button>
                             {
                                 this.state.showOK === true?
                                     <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
@@ -308,7 +308,7 @@ class APIGroupCard extends Component {
                                     const id = idGen('group');
                                     this.ok(id);
                                     this.props.pass(id, 'group');
-                                }} type='primary'>save</Button>
+                                }} type='primary'><FormattedMessage id="save"/></Button>
                                 {
                                     this.state.showOK === true?
                                         <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>

+ 9 - 8
src/app/common/deploy/tencent/APIPathCard.js

@@ -1,4 +1,5 @@
 import React, {Component} from 'react';
+import {FormattedMessage} from 'react-intl';
 import {Input, Radio, Collapse, Button, Icon, Tooltip} from 'antd';
 import {request} from 'graphql-request'
 import {ADD_APIGWPATH, UPDATE_APIGWPATH} from "../../../../gql";
@@ -12,9 +13,9 @@ const Panel = Collapse.Panel;
 // 如需添加中文,请在此处 value 处添加
 // eg: 'xxxx': <F..  id='xxx'/>
 const valueToKey = {
-    'apiGWName': 'Name',
-    'apiGWDesc': 'Description',
-    'requestMethod': 'Method'
+    'apiGWName': 'apiGWName',
+    'apiGWDesc': 'apiGWDesc',
+    'requestMethod': 'requestMethod'
 };
 
 const toolTipTitle = {
@@ -150,11 +151,11 @@ class APIPathCard extends Component {
         return (
             <div>
                 <Collapse bordered={false}>
-                    <Panel header="Want more options?" style={customPanelStyle}>
+                    <Panel header=<FormattedMessage id="Want more options?"/> style={customPanelStyle}>
                         {
                             this.state.configs.map(config => (
                                 <div key={config} style={{marginBottom: 10}}>
-                                    <span className='vice-title'>{valueToKey[config]}
+                                    <span className='vice-title'><FormattedMessage id={valueToKey[config]}/>
                                         &nbsp;
                                         <Tooltip placement="top" title={toolTipTitle[config]}>
                                             <Icon type="question-circle"/>
@@ -166,7 +167,7 @@ class APIPathCard extends Component {
                             ))
                         }
                         <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['requestMethod']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['requestMethod']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['requestMethod']}>
                                     <Icon type="question-circle"/>
@@ -184,7 +185,7 @@ class APIPathCard extends Component {
                 {
                     manageUsers.includes(this.props.userID) ?
                         <div>
-                            <Button onClick={this.ok} type='primary'>save</Button>
+                            <Button onClick={this.ok} type='primary'><FormattedMessage id="save"/></Button>
                             {
                                 this.state.showOK === true?
                                     <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
@@ -197,7 +198,7 @@ class APIPathCard extends Component {
                             ''
                             :
                             <div>
-                                <Button onClick={this.ok} type='primary'>save</Button>
+                                <Button onClick={this.ok} type='primary'><FormattedMessage id="save"/></Button>
                                 {
                                     this.state.showOK === true?
                                         <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>

+ 17 - 16
src/app/common/deploy/tencent/DeployCard.js

@@ -1,4 +1,5 @@
 import React, {Component} from 'react';
+import {FormattedMessage} from 'react-intl';
 import {Input, Radio, Collapse, Button, Icon, Tooltip} from 'antd';
 import {ADD_DEPLOY, UPDATE_DEPLOY} from "../../../../gql";
 import {request} from 'graphql-request'
@@ -12,7 +13,7 @@ const Panel = Collapse.Panel;
 // 如需添加中文,请在此处 value 处添加
 // eg: 'xxxx': <F..  id='xxx'/>
 const valueToKey = {
-    'functionName': 'Name',
+    'functionName': 'functionName',
     'cosBucketName': 'cosBucketName',
     'cosObjectName': 'cosObjectName',
     'cosBucketRegion': 'cosBucketRegion',
@@ -219,7 +220,7 @@ class DeployCard extends Component {
         return (
             <div>
                 <div style={{marginBottom: 10}}>
-                    <span className='vice-title'>{valueToKey['functionName']}
+                    <span className='vice-title'><FormattedMessage id={valueToKey['functionName']}/>
                         &nbsp;
                         <Tooltip placement="top" title={toolTipTitle['functionName']}>
                             <Icon type="question-circle"/>
@@ -229,7 +230,7 @@ class DeployCard extends Component {
                            onChange={this.switchConfig('functionName')}/>
                 </div>
                 <div style={{marginBottom: 10}}>
-                    <span className='vice-title'>{valueToKey['region']}
+                    <span className='vice-title'><FormattedMessage id={valueToKey['region']}/>
                         &nbsp;
                         <Tooltip placement="top" title={toolTipTitle['region']}>
                             <Icon type="question-circle"/>
@@ -239,16 +240,16 @@ class DeployCard extends Component {
                         this.props.switchRegion(e);
                     }} defaultValue={this.state.region} value={removePrefix('ap-', this.state.region)}
                                  buttonStyle="solid">
-                        <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
-                        <Radio.Button value="shanghai">Shanghai</Radio.Button>
-                        <Radio.Button value="beijing">Beijing</Radio.Button>
-                        <Radio.Button value="chengdu">Chengdu</Radio.Button>
+                        <Radio.Button value="guangzhou"><FormattedMessage id="Guangzhou"/></Radio.Button>
+                        <Radio.Button value="shanghai"><FormattedMessage id="Shanghai"/></Radio.Button>
+                        <Radio.Button value="beijing"><FormattedMessage id="Beijing"/></Radio.Button>
+                        <Radio.Button value="chengdu"><FormattedMessage id="Chengdu"/></Radio.Button>
                     </Radio.Group>
                 </div>
                 <Collapse bordered={false}>
-                    <Panel header="Want more options?" style={customPanelStyle}>
+                    <Panel header=<FormattedMessage id="Want more options?"/> style={customPanelStyle}>
                         <div style={{marginBottom: 10}}>
-                            <span className='vice-title'>{valueToKey['cosBucketRegion']}
+                            <span className='vice-title'><FormattedMessage id={valueToKey['cosBucketRegion']}/>
                                 &nbsp;
                                 <Tooltip placement="top" title={toolTipTitle['cosBucketRegion']}>
                                     <Icon type="question-circle"/>
@@ -260,10 +261,10 @@ class DeployCard extends Component {
                                 this.props.switchRegion(e);
                             }} defaultValue={this.state.region}
                                          value={removePrefix('ap-', this.state.cosBucketRegion)} buttonStyle="solid">
-                                <Radio.Button value="guangzhou">Guangzhou</Radio.Button>
-                                <Radio.Button value="shanghai">Shanghai</Radio.Button>
-                                <Radio.Button value="beijing">Beijing</Radio.Button>
-                                <Radio.Button value="chengdu">Chengdu</Radio.Button>
+                                <Radio.Button value="guangzhou"><FormattedMessage id="Guangzhou"/></Radio.Button>
+                                <Radio.Button value="shanghai"><FormattedMessage id="Shanghai"/></Radio.Button>
+                                <Radio.Button value="beijing"><FormattedMessage id="Beijing"/></Radio.Button>
+                                <Radio.Button value="chengdu"><FormattedMessage id="Chengdu"/></Radio.Button>
                             </Radio.Group>
                         </div>
                         {/*腾讯云为空字符串,不显示,这里未作区分*/}
@@ -280,7 +281,7 @@ class DeployCard extends Component {
                         {
                             this.state.configs.map(config => (
                                 <div key={config} style={{marginBottom: 10}}>
-                                    <span className='vice-title'>{valueToKey[config]}
+                                    <span className='vice-title'><FormattedMessage id={valueToKey[config]}/>
                                         &nbsp;
                                         <Tooltip placement="top" title={toolTipTitle[config]}>
                                             <Icon type="question-circle"/>
@@ -301,7 +302,7 @@ class DeployCard extends Component {
                                 const id = idGen('deploy');
                                 this.ok(id);
                                 this.props.pass(id, 'deploy');
-                            }} type='primary'>save</Button>
+                            }} type='primary'><FormattedMessage id="save"/></Button>
                             {
                                 this.state.showOK === true ?
                                     <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>
@@ -318,7 +319,7 @@ class DeployCard extends Component {
                                     const id = idGen('deploy');
                                     this.ok(id);
                                     this.props.pass(id, 'deploy');
-                                }} type='primary'>save</Button>
+                                }} type='primary'><FormattedMessage id="save"/></Button>
                                 {
                                     this.state.showOK === true ?
                                         <Icon type="check-circle" theme="twoTone" twoToneColor="#52c41a"/>

+ 8 - 8
src/app/common/deploy/tencent/NotificationCard.js

@@ -1,20 +1,20 @@
 import React, {Component} from 'react';
+import {FormattedMessage} from 'react-intl';
 import {Input, Tooltip, Icon, Button} from 'antd';
 import {manageUsers} from "../../../../config";
 
 class NotificationCard extends Component {
 
-
     render() {
         return (
             <div>
                 <div className='kind'>
-                    <p style={{marginBottom: 10}}><b>Ding Talk</b></p>
+                    <p style={{marginBottom: 10}}><b><FormattedMessage id="Ding Talk"/></b></p>
                     <div className='item'>
                         <p style={{marginBottom: 10}}>
                             <span className='item-title'>
-                                <span>Web hook  </span>
-                                <Tooltip placement="top" title='hahahha'>
+                                <span><FormattedMessage id="Web hook"/>  </span>
+                                <Tooltip placement="top" title='dingding webhook'>
                                     <Icon type="question-circle"/>
                                 </Tooltip>
                             </span>
@@ -22,8 +22,8 @@ class NotificationCard extends Component {
                         </p>
                         <p style={{marginBottom: 10}}>
                             <span className='item-title'>
-                                <span>Notification Name  </span>
-                                <Tooltip placement="top" title='heheheheh'>
+                                <span><FormattedMessage id="Notification Name"/>  </span>
+                                <Tooltip placement="top" title='notification name'>
                                     <Icon type="question-circle"/>
                                 </Tooltip>
                             </span>
@@ -58,14 +58,14 @@ class NotificationCard extends Component {
                     manageUsers.includes(this.props.userID) ?
                         <Button type="primary" onClick={() => {
                             console.log('hello');
-                        }}>save</Button>
+                        }}><FormattedMessage id="save"/></Button>
                         :
                         this.props.trialcase?
                             ''
                             :
                             <Button type="primary" onClick={() => {
                                 console.log('hello');
-                            }}>save</Button>
+                            }}><FormattedMessage id="save"/></Button>
                 }
 
             </div>

+ 36 - 2
src/language/en_US.js

@@ -29,6 +29,9 @@ const en_US = {
     "Name":"Name",
     "name":"name",
     "type":"type",
+    "region":"region",
+    "function":"function",
+    "functionName":"function Name",
     "description":"description",
     "Remark":"Remark",
     "copy":"copy",
@@ -43,6 +46,37 @@ const en_US = {
     "AWS":"AWS",
     // deploy相关
     "Deploy":"Deploy",
+    'cosBucketName': 'cosBucketName',
+    'cosObjectName': 'cosObjectName',
+    'cosBucketRegion': 'cosBucketRegion',
+    'serviceName': 'service Name',
+    'subnetId': 'subnetId',
+    'vpcId': 'vpcId',
+
+    'groupName': 'group name',
+    'environmentName': 'deploy environment',
+    'defaultDomain': 'default domain',
+    'frontType': 'front type',
+    'userDomain': 'custom domain',
+    'userStatus': 'open/close',
+
+    'apiGWName': 'api gateway group name',
+    'apiGWDesc': 'api gateway group description',
+    'requestMethod': 'request Method',
+
+    'Ding Talk':'Ding Talk',
+    'Notification Name':'Notification Name',
+    'Web hook':'Ding Talk webhook',
+
+    'test':'test',
+    'prepub':'prepub',
+    'release':'release',
+
+    //地区
+    "Guangzhou":"Guangzhou",
+    "Shanghai":"Shanghai",
+    "Beijing":"Beijing",
+    "Chengdu":"Chengdu",
 
     //account 个人中心相关
     "Account center":"Account center",
@@ -72,8 +106,8 @@ const en_US = {
     "field name": 'field name',
     "Confirm": 'Confirm',
     "fc Deploy": "Deploy",
-    "API Group": 'API Group',
-    "API Path": 'API Path',
+    "API Group": 'API Group settings',
+    "API Path": 'API Path settings',
     "Notification": 'Notification',
     "Want more options?": 'Want more options?',
     "Welcome": 'Welcome',

+ 35 - 2
src/language/zh_CN.js

@@ -28,6 +28,9 @@ const zh_CN = {
 
     "Name":"名称",
     "name":"名称",
+    "region":"地区",
+    "function":"函数",
+    "functionName":"函数名称",
     "type":"类型",
     "description":"描述",
     "Remark":"备注",
@@ -43,7 +46,37 @@ const zh_CN = {
     "AWS":"亚马逊",
     // deploy相关
     "Deploy":"部署",
+    'cosBucketName': '存储桶名称',
+    'cosObjectName': '存储桶内文件名',
+    'cosBucketRegion': '存储桶所属地域',
+    'serviceName': '服务名称',
+    'subnetId': '所在子网',
+    'vpcId': '所属网络',
 
+    'groupName': '服务名称',
+    'environmentName': '发布环境',
+    'defaultDomain': '默认域名',
+    'frontType': '前端类型',
+    'userDomain': '自定义域名',
+    'userStatus': '开启状态',
+
+    'apiGWName': 'API名称',
+    'apiGWDesc': 'API描述',
+    'requestMethod': '请求方法',
+
+    'Ding Talk':'钉钉通知',
+    'Notification Name':'通知名称',
+    'Web hook':'钉钉webhook',
+
+    'test':'测试',
+    'prepub':'预发布',
+    'release':'发布',
+
+    //地区
+    "Guangzhou":"广州",
+    "Shanghai":"上海",
+    "Beijing":"北京",
+    "Chengdu":"成都",
 
     //account 个人中心相关
     "Account center":"账户中心",
@@ -74,8 +107,8 @@ const zh_CN = {
     "field name": '字段名',
     "Confirm": '确认修改',
     "fc Deploy": "云函数配置",
-    "API Group": 'API组 配置',
-    "API Path": 'API路径 配置',
+    "API Group": '服务配置',
+    "API Path": 'API配置',
     "Notification": '通知配置',
     "Want more options?": '需要更多配置项?',
     "Welcome": '欢迎',