Bladeren bron

locale(device): merge translate

Lind 4 jaren geleden
bovenliggende
commit
db7265604a

+ 53 - 1
src/locales/en-US/pages.ts

@@ -41,6 +41,7 @@ export default {
   'pages.table.provider': 'Provider',
   'pages.table.type': 'Type',
   'pages.table.deviceId': 'Device ID',
+  'pages.table.createTime': 'Create Time',
 
   // 统计分析
   'pages.analysis.volume': 'Device Message Volume Today',
@@ -129,11 +130,30 @@ export default {
   'pages.system.tenant.list': 'Tenant List',
   'pages.system.tenant.avatar': 'Avatar',
   'pages.system.tenant.members': 'Members',
+  'pages.system.tenant.createTime': 'Create Time',
+  'pages.system.tenant.assetInformation': 'Asset Information',
+  'pages.system.tenant.assetInformation.product': 'Product',
+  'pages.system.tenant.assetInformation.member': 'Member',
+  'pages.system.tenant.assetInformation.published': 'Published',
+  'pages.system.tenant.assetInformation.unpublished': 'Unpublished',
+  'pages.system.tenant.assetInformation.device': 'Device',
+  'pages.system.tenant.assetInformation.onLine': 'On Line',
+  'pages.system.tenant.assetInformation.offLine': 'Off Line',
+  'pages.system.tenant.memberManagement': 'Member Management',
+  'pages.system.tenant.memberManagement.administrators': 'Administrators',
+  'pages.system.tenant.memberManagement.tenantMember': 'Tenant Member',
+  'pages.system.tenant.memberManagement.addUser': 'Add User',
   // 系统设置-数据源管理
   'pages.system.datasource.': 'DataSource',
-
+  // 设备管理-物模型
+  'pages.device.metadata.functions': 'Function',
+  'pages.device.metadata.properties': 'Property',
+  'pages.device.metadata.events': 'Events',
+  'pages.device.metadata.tags': 'Tag',
   // 设备管理-产品
   'pages.device.product': 'Product Manage',
+  'pages.device.product.deviceNumber': 'Number of Devices',
+  'pages.device.product.deviceClass': 'Device Class',
   'pages.device.product.status.published': 'Published',
   'pages.device.product.status.unpublished': 'Unpublished',
   'pages.device.product.status.all': 'All',
@@ -144,8 +164,40 @@ export default {
   'pages.device.productDetail.transportProtocol': 'Link Protocol',
   'pages.device.productDetail.createTime': 'Create Time',
   'pages.device.productDetail.base': 'Configuration Information',
+  'pages.device.productDetail.base.save': 'Save',
   'pages.device.productDetail.metadata': 'Metadata',
+  'pages.device.productDetail.metadata.quickImport': 'Quick Import',
+  'pages.device.productDetail.metadata.propertyDefinition': 'Property Definition',
+  'pages.device.productDetail.metadata.functionDefinition': 'Function Definition',
+  'pages.device.productDetail.metadata.eventDefinition': 'Event Definition',
+  'pages.device.productDetail.metadata.tagDefinition': 'Tag Definition',
+  'pages.device.productDetail.metadata.key': 'Key',
+  'pages.device.productDetail.metadata.eventLevel': 'Event Level',
+  'pages.device.productDetail.metadata.level': 'Level',
+  'pages.device.productDetail.metadata.whetherAsync': 'Whether Async',
+  'pages.device.productDetail.metadata.whetherReadOnly': 'Whether ReadOnly',
+  'pages.device.productDetail.metadata.true': 'true',
+  'pages.device.productDetail.metadata.false': 'false',
+  'pages.device.productDetail.metadata.dataType': 'Data Type',
+  'pages.device.productDetail.metadata.saveData': 'Save Data',
+  'pages.device.productDetail.metadata.accuracy': 'Accuracy',
+  'pages.device.productDetail.metadata.boolean': 'Boolean',
+  'pages.device.productDetail.metadata.timeFormat': 'Time Format',
+  'pages.device.productDetail.metadata.enum': 'Enum',
+  'pages.device.productDetail.metadata.maxLength': 'Max Length',
+  'pages.device.productDetail.metadata.maxLength.byte': 'Byte',
+  'pages.device.productDetail.metadata.elementConfiguration': 'Element Configuration',
+  'pages.device.productDetail.metadata.jsonObject': 'JSON Object',
+  'pages.device.productDetail.metadata.fileType': 'File Type',
+  'pages.device.productDetail.metadata.source': 'Source',
+  'pages.device.productDetail.metadata.otherConfiguration': 'Other Configuration',
+  'pages.device.productDetail.metadata.describe': 'Describe',
+  'pages.device.productDetail.metadata.inputParameter': 'Input Parameter',
+  'pages.device.productDetail.metadata.outputParameters': 'Output Parameters',
   'pages.device.productDetail.alarm': 'Alarm Set',
+  'pages.device.productDetail.alarmLog': 'Alarm Log',
+  'pages.device.productDetail.alarmLog.deviceId': 'Device Id',
+  'pages.device.productDetail.alarmLog.deviceName': 'Device Name',
   'pages.device.productDetail.setting': 'Application Settings',
   'pages.device.productDetail.disable': 'Disable',
   // 设备管理-产品分类

+ 48 - 0
src/locales/zh-CN/pages.ts

@@ -41,6 +41,7 @@ export default {
   'pages.table.provider': '服务商',
   'pages.table.type': '类型',
   'pages.table.deviceId': '设备ID',
+  'pages.table.createTime': '创建时间',
 
   // 统计分析
   'pages.analysis.volume': '今日设备消息量',
@@ -129,6 +130,19 @@ export default {
   'pages.system.tenant.list': '租户列表',
   'pages.system.tenant.avatar': '头像',
   'pages.system.tenant.members': '成员数',
+  'pages.system.tenant.createTime': '创建时间',
+  'pages.system.tenant.assetInformation': '资产信息',
+  'pages.system.tenant.assetInformation.product': '产品',
+  'pages.system.tenant.assetInformation.member': '成员',
+  'pages.system.tenant.assetInformation.published': '已发布',
+  'pages.system.tenant.assetInformation.unpublished': '未发布',
+  'pages.system.tenant.assetInformation.device': '设备',
+  'pages.system.tenant.assetInformation.onLine': '在线',
+  'pages.system.tenant.assetInformation.offLine': '离线',
+  'pages.system.tenant.memberManagement': '成员管理',
+  'pages.system.tenant.memberManagement.administrators': '管理员',
+  'pages.system.tenant.memberManagement.tenantMember': '租户成员',
+  'pages.system.tenant.memberManagement.addUser': '添加用户',
   // 系统设置-数据源管理
   'pages.system.datasource.': '数据源管理',
 
@@ -140,6 +154,8 @@ export default {
 
   // 设备管理-产品
   'pages.device.product': '产品',
+  'pages.device.product.deviceNumber': '设备数量',
+  'pages.device.product.deviceClass': '设备分类',
   'pages.device.product.status.published': '已发布',
   'pages.device.product.status.unpublished': '未发布',
   'pages.device.product.status.all': '全部',
@@ -150,8 +166,40 @@ export default {
   'pages.device.productDetail.transportProtocol': '链接协议',
   'pages.device.productDetail.createTime': '创建时间',
   'pages.device.productDetail.base': '配置信息',
+  'pages.device.productDetail.base.save': '保存',
   'pages.device.productDetail.metadata': '物模型',
+  'pages.device.productDetail.metadata.quickImport': '快速导入',
+  'pages.device.productDetail.metadata.propertyDefinition': '属性定义',
+  'pages.device.productDetail.metadata.functionDefinition': '功能定义',
+  'pages.device.productDetail.metadata.eventDefinition': '事件定义',
+  'pages.device.productDetail.metadata.tagDefinition': '标签定义',
+  'pages.device.productDetail.metadata.key': '标识',
+  'pages.device.productDetail.metadata.eventLevel': '事件级别',
+  'pages.device.productDetail.metadata.level': '级别',
+  'pages.device.productDetail.metadata.whetherAsync': '是否异步',
+  'pages.device.productDetail.metadata.whetherReadOnly': '是否只读',
+  'pages.device.productDetail.metadata.true': '是',
+  'pages.device.productDetail.metadata.false': '否',
+  'pages.device.productDetail.metadata.dataType': '数据类型',
+  'pages.device.productDetail.metadata.saveData': '保存数据',
+  'pages.device.productDetail.metadata.accuracy': '精度',
+  'pages.device.productDetail.metadata.boolean': '布尔值',
+  'pages.device.productDetail.metadata.timeFormat': '时间格式',
+  'pages.device.productDetail.metadata.enum': '枚举项',
+  'pages.device.productDetail.metadata.maxLength': '最大长度',
+  'pages.device.productDetail.metadata.maxLength.byte': '字节',
+  'pages.device.productDetail.metadata.elementConfiguration': '元素配置',
+  'pages.device.productDetail.metadata.jsonObject': 'JSON对象',
+  'pages.device.productDetail.metadata.fileType': '文件类型',
+  'pages.device.productDetail.metadata.source': '来源',
+  'pages.device.productDetail.metadata.otherConfiguration': '其他配置',
+  'pages.device.productDetail.metadata.describe': '描述',
+  'pages.device.productDetail.metadata.inputParameter': '输入参数',
+  'pages.device.productDetail.metadata.outputParameters': '输出参数',
   'pages.device.productDetail.alarm': '告警设置',
+  'pages.device.productDetail.alarmLog': '告警记录',
+  'pages.device.productDetail.alarmLog.deviceId': '设备ID',
+  'pages.device.productDetail.alarmLog.deviceName': '设备名称',
   'pages.device.productDetail.setting': '应用设置',
   'pages.device.productDetail.disable': '停用',
   // 设备管理-产品分类

+ 18 - 4
src/pages/device/Product/Detail/Alarm/Record/index.tsx

@@ -1,8 +1,10 @@
 import type { AlarmRecord } from '@/pages/device/Product/typings';
 import type { ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Record = () => {
+  const intl = useIntl();
   const columns: ProColumns<AlarmRecord>[] = [
     {
       dataIndex: 'index',
@@ -10,21 +12,33 @@ const Record = () => {
       width: 48,
     },
     {
-      title: '设备ID',
+      title: intl.formatMessage({
+        id: 'pages.device.productDetail.alarmLog.deviceId',
+        defaultMessage: '设备ID',
+      }),
       dataIndex: 'deviceId',
     },
     {
-      title: '设备名称',
+      title: intl.formatMessage({
+        id: 'pages.device.productDetail.alarmLog.deviceName',
+        defaultMessage: '设备ID',
+      }),
       dataIndex: 'deviceName',
     },
     {
-      title: '告警时间',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.time',
+        defaultMessage: '告警时间',
+      }),
       dataIndex: 'alarmTime',
       defaultSortOrder: 'descend',
       sorter: true,
     },
     {
-      title: '处理状态',
+      title: intl.formatMessage({
+        id: 'pages.device.alarm.status',
+        defaultMessage: '处理状态',
+      }),
       dataIndex: 'state',
     },
   ];

+ 18 - 4
src/pages/device/Product/Detail/Alarm/Setting/index.tsx

@@ -2,8 +2,10 @@ import type { ProColumns } from '@jetlinks/pro-table';
 import ProTable from '@jetlinks/pro-table';
 import type { AlarmSetting } from '@/pages/device/Product/typings';
 import { Button, Space } from 'antd';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Setting = () => {
+  const intl = useIntl();
   const columns: ProColumns<AlarmSetting>[] = [
     {
       dataIndex: 'index',
@@ -11,19 +13,31 @@ const Setting = () => {
       width: 48,
     },
     {
-      title: '标识',
+      title: intl.formatMessage({
+        id: 'pages.device.category.key',
+        defaultMessage: '标识',
+      }),
       dataIndex: 'id',
     },
     {
-      title: '名称',
+      title: intl.formatMessage({
+        id: 'pages.table.name',
+        defaultMessage: '名称',
+      }),
       dataIndex: 'name',
     },
     {
-      title: '创建时间',
+      title: intl.formatMessage({
+        id: 'pages.table.createTime',
+        defaultMessage: '创建时间',
+      }),
       dataIndex: 'createTime',
     },
     {
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       dataIndex: 'state.text',
     },
   ];

+ 16 - 2
src/pages/device/Product/Detail/Alarm/index.tsx

@@ -1,14 +1,28 @@
 import { Tabs } from 'antd';
 import Setting from '@/pages/device/Product/Detail/Alarm/Setting';
 import Record from '@/pages/device/Product/Detail/Alarm/Record';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Alarm = () => {
+  const intl = useIntl();
   return (
     <Tabs>
-      <Tabs.TabPane key="setting" tab="告警设置">
+      <Tabs.TabPane
+        key="setting"
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.alarm',
+          defaultMessage: '告警设置',
+        })}
+      >
         <Setting />
       </Tabs.TabPane>
-      <Tabs.TabPane key="record" tab="告警记录">
+      <Tabs.TabPane
+        key="record"
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.alarmLog',
+          defaultMessage: '告警记录',
+        })}
+      >
         <Record />
       </Tabs.TabPane>
     </Tabs>

+ 21 - 1
src/pages/device/Product/Detail/BaseInfo/index.tsx

@@ -8,12 +8,14 @@ import type { SetStateAction } from 'react';
 import { useEffect, useState } from 'react';
 import type { ConfigMetadata, ConfigProperty } from '@/pages/device/Product/typings';
 import { useParams } from 'umi';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const componentMap = {
   string: 'Input',
   password: 'Password',
 };
 const BaseInfo = () => {
+  const intl = useIntl();
   const param = useParams<{ id: string }>();
   const [metadata, setMetadata] = useState<ConfigMetadata[]>([]);
   const [state, setState] = useState<boolean>(false);
@@ -82,7 +84,25 @@ const BaseInfo = () => {
           <Card
             key={item.name}
             title={item.name}
-            extra={<a onClick={() => setState(!state)}>{state ? '编辑' : '保存'}</a>}
+            extra={
+              <a onClick={() => setState(!state)}>
+                {state ? (
+                  <>
+                    {intl.formatMessage({
+                      id: 'pages.data.option.edit',
+                      defaultMessage: '编辑',
+                    })}
+                  </>
+                ) : (
+                  <>
+                    {intl.formatMessage({
+                      id: 'pages.device.productDetail.base.save',
+                      defaultMessage: '保存',
+                    })}
+                  </>
+                )}
+              </a>
+            }
           >
             <PreviewText.Placeholder value="-">
               <Form form={form}>

+ 154 - 41
src/pages/device/Product/Detail/Metadata/Base/Edit/index.tsx

@@ -41,6 +41,7 @@ import DB from '@/db';
 import { useParams } from 'umi';
 
 const Edit = () => {
+  const intl = useIntl();
   const form = createForm({
     initialValues: MetadataModel.item as Record<string, unknown>,
   });
@@ -99,14 +100,20 @@ const Edit = () => {
     type: 'object',
     properties: {
       id: {
-        title: '标识',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.key',
+          defaultMessage: '标识',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
         'x-disabled': MetadataModel.action === 'edit',
       },
       name: {
-        title: '名称',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
+          defaultMessage: '名称',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
@@ -115,14 +122,20 @@ const Edit = () => {
         type: 'object',
         properties: {
           type: {
-            title: '数据类型',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.dataType',
+              defaultMessage: '数据类型',
+            }),
             required: true,
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             enum: DataTypeList,
           },
           unit: {
-            title: '单位',
+            title: intl.formatMessage({
+              id: 'pages.device.instanceDetail.metadata.unit',
+              defaultMessage: '单位',
+            }),
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             'x-visible': false,
@@ -137,7 +150,10 @@ const Edit = () => {
             },
           },
           scale: {
-            title: '精度',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.accuracy',
+              defaultMessage: '精度',
+            }),
             'x-decorator': 'FormItem',
             'x-component': 'NumberPicker',
             'x-reactions': {
@@ -150,7 +166,10 @@ const Edit = () => {
             },
           },
           booleanConfig: {
-            title: '布尔值',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.boolean',
+              defaultMessage: '布尔值',
+            }),
             type: 'void',
             'x-decorator': 'FormItem',
             'x-component': 'BooleanEnum',
@@ -164,7 +183,10 @@ const Edit = () => {
             },
           },
           format: {
-            title: '时间格式',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.timeFormat',
+              defaultMessage: '时间格式',
+            }),
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             enum: DateTypeList,
@@ -178,7 +200,10 @@ const Edit = () => {
             },
           },
           enumConfig: {
-            title: '枚举项',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.enum',
+              defaultMessage: '枚举项',
+            }),
             type: 'void',
             'x-decorator': 'FormItem',
             'x-component': 'EnumParam',
@@ -195,11 +220,17 @@ const Edit = () => {
             type: 'object',
             properties: {
               maxLength: {
-                title: '最大长度',
+                title: intl.formatMessage({
+                  id: 'pages.device.productDetail.metadata.maxLength',
+                  defaultMessage: '最大长度',
+                }),
                 'x-decorator': 'FormItem',
                 'x-component': 'NumberPicker',
                 'x-decorator-props': {
-                  tooltip: '字节',
+                  tooltip: intl.formatMessage({
+                    id: 'pages.device.productDetail.metadata.maxLength.byte',
+                    defaultMessage: '字节',
+                  }),
                 },
                 'x-reactions': {
                   dependencies: ['..type'],
@@ -213,7 +244,10 @@ const Edit = () => {
             },
           },
           elementType: {
-            title: '元素配置',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.elementConfiguration',
+              defaultMessage: '元素配置',
+            }),
             'x-decorator': 'FormItem',
             'x-component': 'ArrayParam',
             'x-reactions': {
@@ -226,7 +260,10 @@ const Edit = () => {
             },
           },
           jsonConfig: {
-            title: 'JSON对象',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.jsonObject',
+              defaultMessage: 'JSON对象',
+            }),
             type: 'void',
             'x-decorator': 'FormItem',
             'x-component': 'JsonParam',
@@ -240,7 +277,10 @@ const Edit = () => {
             },
           },
           fileType: {
-            title: '文件类型',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.fileType',
+              defaultMessage: '文件类型',
+            }),
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             'x-visible': false,
@@ -260,24 +300,36 @@ const Edit = () => {
         type: 'object',
         properties: {
           source: {
-            title: '来源',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.source',
+              defaultMessage: '来源',
+            }),
             required: true,
             'x-decorator': 'FormItem',
             'x-component': 'Select',
             enum: PropertySource,
           },
           readOnly: {
-            title: '是否只读',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.whetherReadOnly',
+              defaultMessage: '是否只读',
+            }),
             required: true,
             'x-decorator': 'FormItem',
             'x-component': 'Radio.Group',
             enum: [
               {
-                label: '是',
+                label: intl.formatMessage({
+                  id: 'pages.device.productDetail.metadata.true',
+                  defaultMessage: '是',
+                }),
                 value: true,
               },
               {
-                label: '否',
+                label: intl.formatMessage({
+                  id: 'pages.device.productDetail.metadata.false',
+                  defaultMessage: '否',
+                }),
                 value: false,
               },
             ],
@@ -285,7 +337,10 @@ const Edit = () => {
           // 存储配置
           configConfig: {
             type: 'void',
-            title: '其他配置',
+            title: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.otherConfiguration',
+              defaultMessage: '其他配置',
+            }),
             'x-visible': false,
             'x-decorator': 'FormItem',
             'x-component': 'ConfigParam',
@@ -295,7 +350,10 @@ const Edit = () => {
       },
 
       description: {
-        title: '描述',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.describe',
+          defaultMessage: '描述',
+        }),
         'x-decorator': 'FormItem',
         'x-component': 'Input.TextArea',
       },
@@ -306,47 +364,71 @@ const Edit = () => {
     type: 'object',
     properties: {
       id: {
-        title: '标识',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.key',
+          defaultMessage: '标识',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       name: {
-        title: '名称',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
+          defaultMessage: '名称',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       async: {
-        title: '是否异步',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.whetherAsync',
+          defaultMessage: '是否异步',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Radio.Group',
         enum: [
           {
-            label: '是',
+            label: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.true',
+              defaultMessage: '是',
+            }),
             value: true,
           },
           {
-            label: '否',
+            label: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.false',
+              defaultMessage: '否',
+            }),
             value: false,
           },
         ],
       },
       inputParams: {
-        title: '输入参数',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.inputParameter',
+          defaultMessage: '输入参数',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       outputParams: {
-        title: '输出参数',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.outputParameters',
+          defaultMessage: '输出参数',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       description: {
-        title: '描述',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.describe',
+          defaultMessage: '描述',
+        }),
         'x-decorator': 'FormItem',
         'x-component': 'Input.TextArea',
       },
@@ -357,19 +439,28 @@ const Edit = () => {
     type: 'object',
     properties: {
       id: {
-        title: '标识',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.key',
+          defaultMessage: '标识',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       name: {
-        title: '名称',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
+          defaultMessage: '名称',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       'expands.level': {
-        title: '级别',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.level',
+          defaultMessage: 'level',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Select',
@@ -382,42 +473,63 @@ const Edit = () => {
     type: 'object',
     properties: {
       id: {
-        title: '标识',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.key',
+          defaultMessage: '标识',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       name: {
-        title: '名称',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
+          defaultMessage: '名称',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
       },
       'valueType.type': {
-        title: '数据类型',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.dataType',
+          defaultMessage: '数据类型',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Select',
         enum: DataTypeList,
       },
       'expands.readOnly': {
-        title: '是否只读',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.whetherReadOnly',
+          defaultMessage: '是否只读',
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Radio.Group',
         enum: [
           {
-            label: '是',
+            label: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.true',
+              defaultMessage: '是',
+            }),
             value: true,
           },
           {
-            label: '否',
+            label: intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.false',
+              defaultMessage: '否',
+            }),
             value: false,
           },
         ],
       },
       description: {
-        title: '描述',
+        title: intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.describe',
+          defaultMessage: '描述',
+        }),
         'x-decorator': 'FormItem',
         'x-component': 'Input.TextArea',
       },
@@ -464,8 +576,6 @@ const Edit = () => {
     });
   }, [getUnits]);
 
-  const intl = useIntl();
-
   const saveMetadata = async (type: MetadataType, params: MetadataItem) => {
     const product = productModel.current;
     if (!product) return;
@@ -501,7 +611,7 @@ const Edit = () => {
         defaultMessage: '新增',
       })}-${intl.formatMessage({
         id: `pages.device.metadata.${MetadataModel.type}`,
-        defaultMessage: '',
+        defaultMessage: metadataTypeMapping[MetadataModel.type].name,
       })}`}
       onClose={() => {
         MetadataModel.edit = false;
@@ -519,7 +629,10 @@ const Edit = () => {
             await saveMetadata(type, data);
           }}
         >
-          保存数据
+          {intl.formatMessage({
+            id: 'pages.device.productDetail.metadata.saveData',
+            defaultMessage: '保存数据',
+          })}
         </Button>
       }
     >

+ 6 - 1
src/pages/device/Product/Detail/Metadata/Base/index.tsx

@@ -12,6 +12,7 @@ import { observer } from '@formily/react';
 import MetadataModel from '@/pages/device/Product/Detail/Metadata/Base/model';
 import { Store } from 'jetlinks-store';
 import SystemConst from '@/utils/const';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 interface Props {
   type: MetadataType;
@@ -19,6 +20,7 @@ interface Props {
 
 const BaseMetadata = observer((props: Props) => {
   const { type } = props;
+  const intl = useIntl();
   const param = useParams<{ id: string }>();
 
   const [loading, setLoading] = useState<boolean>(true);
@@ -93,7 +95,10 @@ const BaseMetadata = observer((props: Props) => {
             icon={<PlusOutlined />}
             type="primary"
           >
-            新建
+            {intl.formatMessage({
+              id: 'pages.searchTable.new',
+              defaultMessage: '新建',
+            })}
           </Button>,
         ]}
       />

+ 43 - 6
src/pages/device/Product/Detail/Metadata/index.tsx

@@ -1,28 +1,65 @@
 import { observer } from '@formily/react';
 import { Button, Space, Tabs } from 'antd';
 import BaseMetadata from '@/pages/device/Product/Detail/Metadata/Base';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Metadata = observer(() => {
+  const intl = useIntl();
   return (
     <Tabs
       tabBarExtraContent={
         <Space>
-          <Button>快速导入</Button>
-          <Button>物模型TSL</Button>
+          <Button>
+            {intl.formatMessage({
+              id: 'pages.device.productDetail.metadata.quickImport',
+              defaultMessage: '快速导入',
+            })}
+          </Button>
+          <Button>
+            {intl.formatMessage({
+              id: 'pages.device.productDetail.metadata',
+              defaultMessage: '物模型',
+            })}{' '}
+            TSL
+          </Button>
         </Space>
       }
       destroyInactiveTabPane
     >
-      <Tabs.TabPane tab="属性定义" key="properties">
+      <Tabs.TabPane
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.propertyDefinition',
+          defaultMessage: '属性定义',
+        })}
+        key="properties"
+      >
         <BaseMetadata type={'properties'} />
       </Tabs.TabPane>
-      <Tabs.TabPane tab="功能定义" key="functions">
+      <Tabs.TabPane
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.functionDefinition',
+          defaultMessage: '功能定义',
+        })}
+        key="functions"
+      >
         <BaseMetadata type={'functions'} />
       </Tabs.TabPane>
-      <Tabs.TabPane tab="事件定义" key="events">
+      <Tabs.TabPane
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.eventDefinition',
+          defaultMessage: '事件定义',
+        })}
+        key="events"
+      >
         <BaseMetadata type={'events'} />
       </Tabs.TabPane>
-      <Tabs.TabPane tab="标签定义" key="tags">
+      <Tabs.TabPane
+        tab={intl.formatMessage({
+          id: 'pages.device.productDetail.metadata.tagDefinition',
+          defaultMessage: '标签定义',
+        })}
+        key="tags"
+      >
         <BaseMetadata type={'tags'} />
       </Tabs.TabPane>
     </Tabs>

+ 22 - 2
src/pages/device/Product/Detail/index.tsx

@@ -1,9 +1,9 @@
 import { PageContainer } from '@ant-design/pro-layout';
 import { history, useParams } from 'umi';
-import { Button, Card, Descriptions, Space, Tabs } from 'antd';
+import { Button, Card, Descriptions, Space, Tabs, Badge } from 'antd';
 import BaseInfo from '@/pages/device/Product/Detail/BaseInfo';
 import { observer } from '@formily/react';
-import { productModel, service, statusMap } from '@/pages/device/Product';
+import { productModel, service } from '@/pages/device/Product';
 import { useEffect } from 'react';
 import { useIntl } from '@@/plugin-locale/localeExports';
 import Metadata from '@/pages/device/Product/Detail/Metadata';
@@ -13,6 +13,26 @@ import DB from '@/db';
 
 const ProductDetail = observer(() => {
   const intl = useIntl();
+  const statusMap = {
+    1: (
+      <Badge
+        status="processing"
+        text={intl.formatMessage({
+          id: 'pages.system.tenant.assetInformation.published',
+          defaultMessage: '已发布',
+        })}
+      />
+    ),
+    0: (
+      <Badge
+        status="error"
+        text={intl.formatMessage({
+          id: 'pages.system.tenant.assetInformation.unpublished',
+          defaultMessage: '未发布',
+        })}
+      />
+    ),
+  };
   const param = useParams<{ id: string }>();
 
   useEffect(() => {

+ 33 - 3
src/pages/device/Product/index.tsx

@@ -31,6 +31,26 @@ export const productModel = model<{
 });
 const Product = observer(() => {
   const intl = useIntl();
+  const status = {
+    1: (
+      <Badge
+        status="processing"
+        text={intl.formatMessage({
+          id: 'pages.system.tenant.assetInformation.published',
+          defaultMessage: '已发布',
+        })}
+      />
+    ),
+    0: (
+      <Badge
+        status="error"
+        text={intl.formatMessage({
+          id: 'pages.system.tenant.assetInformation.unpublished',
+          defaultMessage: '未发布',
+        })}
+      />
+    ),
+  };
   return (
     <PageContainer>
       <Card>
@@ -84,7 +104,7 @@ const Product = observer(() => {
             },
             subTitle: {
               dataIndex: 'state',
-              render: (_, row) => <Space size={0}>{statusMap[row.state]}</Space>,
+              render: (_, row) => <Space size={0}>{status[row.state]}</Space>,
               search: false,
             },
             content: {
@@ -113,7 +133,12 @@ const Product = observer(() => {
                       width: 200,
                     }}
                   >
-                    <div>设备数量</div>
+                    <div>
+                      {intl.formatMessage({
+                        id: 'pages.device.product.deviceNumber',
+                        defaultMessage: '设备数量',
+                      })}
+                    </div>
                     <Badge
                       showZero={true}
                       className="site-badge-count-109"
@@ -126,7 +151,12 @@ const Product = observer(() => {
                       width: 200,
                     }}
                   >
-                    <div>设备分类</div>
+                    <div>
+                      {intl.formatMessage({
+                        id: 'pages.device.product.deviceClass',
+                        defaultMessage: '设备分类',
+                      })}
+                    </div>
                     <Tag icon={<GoldOutlined />} color="#55acee">
                       {' '}
                       {row.deviceType.text}

+ 45 - 7
src/pages/system/Tenant/Detail/Assets/index.tsx

@@ -9,8 +9,10 @@ import { useParams } from 'umi';
 import TenantModel from '@/pages/system/Tenant/model';
 import type { TenantMember } from '@/pages/system/Tenant/typings';
 import encodeQuery from '@/utils/encodeQuery';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Assets = observer(() => {
+  const intl = useIntl();
   const param = useParams<{ id: string }>();
 
   const getDeviceCount = (type: 'online' | 'offline') => {
@@ -68,7 +70,13 @@ const Assets = observer(() => {
   }, [TenantModel.assetsMemberId]);
   return (
     <Card>
-      <Form.Item label="成员" style={{ width: 200 }}>
+      <Form.Item
+        label={intl.formatMessage({
+          id: 'pages.system.tenant.assetInformation.member',
+          defaultMessage: '成员',
+        })}
+        style={{ width: 200 }}
+      >
         <Select
           onChange={(id: string) => {
             TenantModel.assetsMemberId = id;
@@ -78,33 +86,63 @@ const Assets = observer(() => {
       </Form.Item>
       <ProCard gutter={[16, 16]} style={{ marginTop: 16 }}>
         <ProCard
-          title="产品"
+          title={intl.formatMessage({
+            id: 'pages.system.tenant.assetInformation.product',
+            defaultMessage: '产品',
+          })}
           colSpan="25%"
           bordered
           actions={[<EyeOutlined key="setting" />, <EditOutlined key="edit" />]}
         >
           <Row>
             <Col span={12}>
-              <Statistic title="已发布" value={TenantModel.assets.product['1']} />
+              <Statistic
+                title={intl.formatMessage({
+                  id: 'pages.system.tenant.assetInformation.published',
+                  defaultMessage: '已发布',
+                })}
+                value={TenantModel.assets.product['1']}
+              />
             </Col>
             <Col span={12}>
-              <Statistic title="未发布" value={TenantModel.assets.product['0']} />
+              <Statistic
+                title={intl.formatMessage({
+                  id: 'pages.system.tenant.assetInformation.unpublished',
+                  defaultMessage: '未发布',
+                })}
+                value={TenantModel.assets.product['0']}
+              />
             </Col>
           </Row>
         </ProCard>
 
         <ProCard
-          title="设备"
+          title={intl.formatMessage({
+            id: 'pages.system.tenant.assetInformation.device',
+            defaultMessage: '设备',
+          })}
           colSpan="25%"
           bordered
           actions={[<EyeOutlined key="setting" />, <EditOutlined key="edit" />]}
         >
           <Row>
             <Col span={12}>
-              <Statistic title="在线" value={TenantModel.assets.device.online} />
+              <Statistic
+                title={intl.formatMessage({
+                  id: 'pages.system.tenant.assetInformation.onLine',
+                  defaultMessage: '在线',
+                })}
+                value={TenantModel.assets.device.online}
+              />
             </Col>
             <Col span={12}>
-              <Statistic title="离线" value={TenantModel.assets.device.offline} />
+              <Statistic
+                title={intl.formatMessage({
+                  id: 'pages.system.tenant.assetInformation.offLine',
+                  defaultMessage: '离线',
+                })}
+                value={TenantModel.assets.device.offline}
+              />
             </Col>
           </Row>
         </ProCard>

+ 18 - 2
src/pages/system/Tenant/Detail/Info/index.tsx

@@ -1,13 +1,29 @@
 import { Descriptions } from 'antd';
 import TenantModel from '@/pages/system/Tenant/model';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Info = () => {
+  const intl = useIntl();
   return (
     <div>
       <Descriptions size="small" column={3}>
         <Descriptions.Item label="ID">{TenantModel.detail?.id}</Descriptions.Item>
-        <Descriptions.Item label="名称">{TenantModel.detail?.name}</Descriptions.Item>
-        <Descriptions.Item label="状态">{TenantModel.detail?.state?.text}</Descriptions.Item>
+        <Descriptions.Item
+          label={intl.formatMessage({
+            id: 'pages.table.name',
+            defaultMessage: '名称',
+          })}
+        >
+          {TenantModel.detail?.name}
+        </Descriptions.Item>
+        <Descriptions.Item
+          label={intl.formatMessage({
+            id: 'pages.searchTable.titleStatus',
+            defaultMessage: '状态',
+          })}
+        >
+          {TenantModel.detail?.state?.text}
+        </Descriptions.Item>
       </Descriptions>
     </div>
   );

+ 10 - 2
src/pages/system/Tenant/Detail/Member/Bind.tsx

@@ -6,25 +6,33 @@ import { useParams } from 'umi';
 import TenantModel from '@/pages/system/Tenant/model';
 import { observer } from '@formily/react';
 import { useRef } from 'react';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 interface Props {
   reload: () => void;
 }
 
 const Bind = observer((props: Props) => {
+  const intl = useIntl();
   const param = useParams<{ id: string }>();
   const actionRef = useRef<ActionType>();
   const columns: ProColumns<UserItem>[] = [
     {
       dataIndex: 'name',
-      title: '姓名',
+      title: intl.formatMessage({
+        id: 'pages.system.name',
+        defaultMessage: '姓名',
+      }),
       search: {
         transform: (value) => ({ name$LIKE: value }),
       },
     },
     {
       dataIndex: 'username',
-      title: '用户名',
+      title: intl.formatMessage({
+        id: 'pages.system.username',
+        defaultMessage: '用户名',
+      }),
       search: {
         transform: (value) => ({ username$LIKE: value }),
       },

+ 28 - 6
src/pages/system/Tenant/Detail/Member/index.tsx

@@ -9,8 +9,10 @@ import Bind from '@/pages/system/Tenant/Detail/Member/Bind';
 import { observer } from '@formily/react';
 import TenantModel from '@/pages/system/Tenant/model';
 import { useRef } from 'react';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const Member = observer(() => {
+  const intl = useIntl();
   const actionRef = useRef<ActionType>();
 
   const param = useParams<{ id: string }>();
@@ -22,19 +24,28 @@ const Member = observer(() => {
     },
     {
       dataIndex: 'name',
-      title: '姓名',
+      title: intl.formatMessage({
+        id: 'pages.system.name',
+        defaultMessage: '姓名',
+      }),
       search: {
         transform: (value) => ({ name$LIKE: value }),
       },
     },
     {
-      title: '管理员',
+      title: intl.formatMessage({
+        id: 'pages.system.tenant.memberManagement.administrators',
+        defaultMessage: '管理员',
+      }),
       dataIndex: 'adminMember',
       renderText: (text) => (text ? '是' : '否'),
       search: false,
     },
     {
-      title: '状态',
+      title: intl.formatMessage({
+        id: 'pages.searchTable.titleStatus',
+        defaultMessage: '状态',
+      }),
       dataIndex: 'state',
       renderText: (text) => text.text,
       search: false,
@@ -53,7 +64,12 @@ const Member = observer(() => {
   return (
     <Row gutter={[16, 16]}>
       <Col span={TenantModel.bind ? 12 : 24}>
-        <Card title="租户成员">
+        <Card
+          title={intl.formatMessage({
+            id: 'pages.system.tenant.memberManagement.tenantMember',
+            defaultMessage: '租户成员',
+          })}
+        >
           <ProTable
             actionRef={actionRef}
             columns={columns}
@@ -93,7 +109,10 @@ const Member = observer(() => {
                 type="primary"
                 key="bind"
               >
-                绑定用户
+                {intl.formatMessage({
+                  id: 'pages.system.role.option.bindUser',
+                  defaultMessage: '绑定用户',
+                })}
               </Button>,
             ]}
           />
@@ -102,7 +121,10 @@ const Member = observer(() => {
       {TenantModel.bind && (
         <Col span={12}>
           <Card
-            title="添加用户"
+            title={intl.formatMessage({
+              id: 'pages.system.tenant.memberManagement.addUser',
+              defaultMessage: '添加用户',
+            })}
             extra={
               <CloseOutlined
                 onClick={() => {

+ 10 - 2
src/pages/system/Tenant/Detail/index.tsx

@@ -7,8 +7,10 @@ import { service } from '@/pages/system/Tenant';
 import Assets from '@/pages/system/Tenant/Detail/Assets';
 import Member from '@/pages/system/Tenant/Detail/Member';
 import Info from '@/pages/system/Tenant/Detail/Info';
+import { useIntl } from '@@/plugin-locale/localeExports';
 
 const TenantDetail = observer(() => {
+  const intl = useIntl();
   const [tab, setTab] = useState<string>('assets');
   const params = useParams<{ id: string }>();
   const getDetail = (id: string) => {
@@ -29,12 +31,18 @@ const TenantDetail = observer(() => {
   const list = [
     {
       key: 'assets',
-      tab: '资产信息',
+      tab: intl.formatMessage({
+        id: 'pages.system.tenant.assetInformation',
+        defaultMessage: '资产信息',
+      }),
       component: <Assets />,
     },
     {
       key: 'member',
-      tab: '成员管理',
+      tab: intl.formatMessage({
+        id: 'pages.system.tenant.memberManagement',
+        defaultMessage: '成员管理',
+      }),
       component: <Member />,
     },
   ];

+ 4 - 1
src/pages/system/Tenant/index.tsx

@@ -95,7 +95,10 @@ const Tenant = observer(() => {
       ],
     },
     {
-      title: '创建时间',
+      title: intl.formatMessage({
+        id: 'pages.system.tenant.createTime',
+        defaultMessage: '创建时间',
+      }),
       dataIndex: 'tenant',
       width: '200px',
       align: 'center',