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

locale(rule-engine): translate rule-engine

crush394 4 лет назад
Родитель
Сommit
9b83ccd41a

+ 36 - 3
src/locales/en-US/menu.ts

@@ -11,18 +11,51 @@ export default {
   'menu.system.open-api': 'OpenAPI',
   'menu.system.permission': 'Permission',
   'menu.system.tenant': 'Tenant',
+  'menu.system.datasource': 'Data Source',
   'menu.device': 'Device',
   'menu.device.product': 'Product',
   'menu.device.product-detail': 'ProductDetail',
+  'menu.device.category': 'Category',
   'menu.device.instance': 'Instance',
   'menu.device.instance-detail': 'InstanceDetail',
   'menu.device.command': 'Command',
   'menu.device.firmware': 'Firmware',
   'menu.device.alarm': 'Alarm',
-
+  'menu.link': 'Link',
+  'menu.link.certificate': 'Certificate',
+  'menu.link.protocol': 'Protocol',
+  'menu.link.type': 'Type',
+  'menu.link.gateway': 'Gateway',
+  'menu.link.opcua': 'OPC UA',
+  'menu.notice': 'Notice',
+  'menu.notice.config': 'Config',
+  'menu.notice.template': 'Template',
+  'menu.rule-engine': 'Rule-engine',
+  'menu.rule-engine.instance': 'Instance',
+  'menu.rule-engine.sqlRule': 'SQL Rule',
+  'menu.rule-engine.scene': 'Scene',
+  'menu.visualization': 'Visualization',
+  'menu.visualization.category': 'Category',
+  'menu.visualization.screen': 'Screen',
+  'menu.visualization.configuration': 'Configuration',
+  'menu.simulator': 'Simulator',
+  'menu.simulator.device': 'Device',
   'menu.log': 'Log',
-  'menu.log.access': 'AccessLog',
-  'menu.log.System': 'System Log',
+  'menu.log.access': 'Access Log',
+  'menu.log.system': 'System Log',
+  'menu.cloud': 'Cloud',
+  'menu.cloud.duer': 'DuerOS',
+  'menu.cloud.aliyun': 'Aliyun',
+  'menu.cloud.onenet': 'Mobile OneNet',
+  'menu.cloud.ctwing': 'Telecom CTWing',
+  'menu.media': 'Media',
+  'menu.media.config': 'Config',
+  'menu.media.device': 'Device',
+  'menu.media.reveal': 'Reveal',
+  'menu.media.cascade': 'Cascade',
+  'menu.edge': 'Edge',
+  'menu.edge.product': 'Product',
+  'menu.edge.device': 'Device',
   'menu.admin.sub-page': 'Sub-Page',
   'menu.login': 'Login',
   'menu.register': 'Register',

+ 12 - 5
src/locales/en-US/pages.ts

@@ -11,7 +11,7 @@ export default {
   'pages.notification.error': 'Your network is abnormal and you cannot connect to the server',
 
   // 通用的数据操作
-  'pages.data.option': 'option',
+  'pages.data.option': 'Option',
   'pages.data.option.remove': 'delete',
   'pages.data.option.remove.tips': 'Confirm to delete?',
   'pages.data.option.disabled': 'disable',
@@ -37,6 +37,7 @@ export default {
   'pages.table.equipmentName': 'Equipment Name',
   'pages.table.describe': 'Describe',
   'pages.table.description': 'Explain',
+  'pages.table.type': 'Type',
 
   // 统计分析
   'pages.analysis.cpu': 'CPU Usage',
@@ -81,7 +82,6 @@ export default {
   'pages.system.tenant.members': 'Members',
   // 系统设置-数据源管理
   'pages.system.datasource.': 'Data Source',
-  'pages.system.datasource.type': 'Type',
 
   // 设备管理-产品
   'pages.device.product': 'Product',
@@ -133,18 +133,22 @@ export default {
   // 设备接入
   'pages.link.certificate': 'Certificate',
   'pages.link.protocol': 'protocol',
-  'pages.link.type': 'Type',
+  'pages.link.type': 'Network components',
   'pages.link.gateway': 'Gateway',
   'pages.link.opcua': 'OPC UA',
 
   // 通知管理
   'pages.notice.config': 'Config',
+  'pages.notice.config.service': 'Service',
+  'pages.notice.config.type': 'Type',
   'pages.notice.template': 'Template',
 
   // 规则引擎
   'pages.ruleEngine.instance': 'Instance',
   'pages.ruleEngine.sqlRule': 'SQL Rule',
+  'pages.ruleEngine.sqlRule.time': 'Create Time',
   'pages.ruleEngine.scene': 'Scene',
+  'pages.ruleEngine.scene.trigger': 'Trigger',
 
   // 可视化
   'pages.visualization.category': 'Category',
@@ -171,9 +175,12 @@ export default {
 
   // 云云对接
   'pages.cloud.duerOS': 'Duer OS',
+  'pages.cloud.duerOS.applianceType': 'Appliance Type',
+  'pages.cloud.duerOS.manufacturerName': 'Manufacture Name',
+  'pages.cloud.duerOS.version': 'Version',
   'pages.cloud.aliyun': 'Aliyun',
-  'pages.cloud.onenet': '移动OneNet',
-  'pages.cloud.ctwing': '电信CTWing',
+  'pages.cloud.onenet': 'Mobile OneNet',
+  'pages.cloud.ctwing': 'Telecom CTWing',
 
   // 视频网关
   'pages.media.config': 'Config',

+ 8 - 1
src/locales/zh-CN/pages.ts

@@ -37,6 +37,7 @@ export default {
   'pages.table.equipmentName': '设备名称',
   'pages.table.describe': '描述',
   'pages.table.description': '说明',
+  'pages.table.type': '类型',
 
   // 统计分析
   'pages.analysis.cpu': 'CPU使用率',
@@ -81,7 +82,6 @@ export default {
   'pages.system.tenant.members': '成员数',
   // 系统设置-数据源管理
   'pages.system.datasource.': '数据源管理',
-  'pages.system.datasource.type': '类型',
 
   // 设备管理-产品
   'pages.device.product': '产品',
@@ -138,12 +138,16 @@ export default {
 
   // 通知管理
   'pages.notice.config': '通知配置',
+  'pages.notice.config.service': '服务商',
+  'pages.notice.config.type': '通知类型',
   'pages.notice.template': '通知模板',
 
   // 规则引擎
   'pages.ruleEngine.instance': '规则实例',
   'pages.ruleEngine.sqlRule': '数据转发',
+  'pages.ruleEngine.sqlRule.time': '创建时间',
   'pages.ruleEngine.scene': '场景联动',
+  'pages.ruleEngine.scene.trigger': '触发方式',
 
   // 可视化
   'pages.visualization.category': '分类管理',
@@ -169,6 +173,9 @@ export default {
 
   // 云云对接
   'pages.cloud.duerOS': 'Duer OS',
+  'pages.cloud.duerOS.applianceType': '设备类型',
+  'pages.cloud.duerOS.manufacturerName': '厂家名称',
+  'pages.cloud.duerOS.version': '动作数量',
   'pages.cloud.aliyun': '阿里云',
   'pages.cloud.onenet': '移动OneNet',
   'pages.cloud.ctwing': '电信CTWing',

+ 22 - 5
src/pages/rule-engine/Instance/index.tsx

@@ -12,9 +12,11 @@ import {
 } from '@ant-design/icons';
 import { Tooltip } from 'antd';
 import BaseCrud from '@/components/BaseCrud';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<InstanceItem>('rule-engine/instance');
 const Instance = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<InstanceItem>[] = [
@@ -25,19 +27,31 @@ const Instance = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'modelType',
-      title: '类型',
+      title: intl.formatMessage({
+        id: 'pages.table.type',
+        defaultMessage: '类型',
+      }),
     },
     {
       dataIndex: 'state',
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       render: (text, record) => record.state.value,
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
@@ -79,7 +93,10 @@ const Instance = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="规则实例"
+        title={intl.formatMessage({
+          id: 'pages.ruleEngine.instance',
+          defaultMessage: '规则实例',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 22 - 5
src/pages/rule-engine/SQLRule/index.tsx

@@ -13,8 +13,10 @@ import {
 } from '@ant-design/icons';
 import BaseCrud from '@/components/BaseCrud';
 import { service } from '@/pages/rule-engine/Instance';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const SQLRule = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<SQLRuleItem>[] = [
@@ -25,19 +27,31 @@ const SQLRule = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'createTime',
-      title: '创建时间',
+      title: intl.formatMessage({
+        id: 'pages.ruleEngine.sqlRule.time',
+        defaultMessage: '创建时间',
+      }),
     },
     {
       dataIndex: 'state',
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       render: (text, record) => record.state.value,
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.table.type',
+        defaultMessage: '类型',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
@@ -86,7 +100,10 @@ const SQLRule = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="数据转发"
+        title={intl.formatMessage({
+          id: 'pages.ruleEngine.sqlRule',
+          defaultMessage: '数据转发',
+        })}
         schema={schema}
         defaultParams={{ modelType: 'sql_rule' }}
         actionRef={actionRef}

+ 22 - 5
src/pages/rule-engine/Scene/index.tsx

@@ -13,9 +13,11 @@ import {
   StopOutlined,
 } from '@ant-design/icons';
 import BaseCrud from '@/components/BaseCrud';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 export const service = new BaseService<SceneItem>('rule-engine/scene');
 const Scene = () => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const columns: ProColumns<SceneItem>[] = [
@@ -26,20 +28,32 @@ const Scene = () => {
     },
     {
       dataIndex: 'name',
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
     },
     {
       dataIndex: 'triggers',
-      title: '触发方式',
+      title: intl.formatMessage({
+        id: 'pages.ruleEngine.scene.trigger',
+        defaultMessage: '触发方式',
+      }),
       render: () => 'todo',
     },
     {
       dataIndex: 'state',
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       render: (text, record) => record.state.value,
     },
     {
-      title: '操作',
+      title: intl.formatMessage({
+        id: 'pages.data.option',
+        defaultMessage: '操作',
+      }),
       valueType: 'option',
       align: 'center',
       width: 200,
@@ -86,7 +100,10 @@ const Scene = () => {
       <BaseCrud
         columns={columns}
         service={service}
-        title="场景联动"
+        title={intl.formatMessage({
+          id: 'pages.ruleEngine.scene',
+          defaultMessage: '场景联动',
+        })}
         schema={schema}
         actionRef={actionRef}
       />

+ 11 - 11
src/pages/system/DataSource/index.tsx

@@ -52,21 +52,21 @@ const DataSource = () => {
     },
     {
       title: intl.formatMessage({
-      id:   'pages.table.name',
-      defaultMessage: '名称',
-    }),
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
       dataIndex: 'name',
     },
     {
       title: intl.formatMessage({
-        id:  'pages.system.datasource.type',
+        id: 'pages.table.type',
         defaultMessage: '类型',
       }),
       dataIndex: 'typeId',
     },
     {
       title: intl.formatMessage({
-        id:  'pages.table.description',
+        id: 'pages.table.description',
         defaultMessage: '说明',
       }),
       dataIndex: 'description',
@@ -81,7 +81,7 @@ const DataSource = () => {
     },
     {
       title: intl.formatMessage({
-        id:'pages.data.option',
+        id: 'pages.data.option',
         defaultMessage: '说明',
       }),
       valueType: 'option',
@@ -147,7 +147,7 @@ const DataSource = () => {
         properties: {
           name: {
             title: intl.formatMessage({
-              id:   'pages.table.name',
+              id: 'pages.table.name',
               defaultMessage: '名称',
             }),
             'x-component': 'Input',
@@ -159,7 +159,7 @@ const DataSource = () => {
           },
           typeId: {
             title: intl.formatMessage({
-              id:  'pages.system.datasource.type',
+              id: 'pages.table.type',
               defaultMessage: '类型',
             }),
             'x-component': 'Select',
@@ -319,9 +319,9 @@ const DataSource = () => {
         columns={columns}
         service={service}
         title={intl.formatMessage({
-            id: 'pages.system.datasource.',
-            defaultMessage: '数据源管理',
-          })}
+          id: 'pages.system.datasource.',
+          defaultMessage: '数据源管理',
+        })}
         schema={schema}
         actionRef={actionRef}
       />