From 937734014051d8d3c1606b3bfc6ff2215b9546bf Mon Sep 17 00:00:00 2001 From: 0721Betty <1942433767@qq.com> Date: Wed, 6 Mar 2024 18:14:25 +0800 Subject: [PATCH] feat(i18n): add all dashbaord symbol labels --- .../i18n/lib/__test__/enSymbolLabel.test.ts | 10 +++++ .../i18n/lib/__test__/zhSymbolLabel.test.ts | 10 +++++ packages/i18n/lib/enSymbolLabel.ts | 41 +++++++++++++++++++ packages/i18n/lib/index.ts | 2 + packages/i18n/lib/zhSymbolLabel.ts | 41 +++++++++++++++++++ packages/i18n/src/main.ts | 6 +++ 6 files changed, 110 insertions(+) create mode 100644 packages/i18n/lib/__test__/enSymbolLabel.test.ts create mode 100644 packages/i18n/lib/__test__/zhSymbolLabel.test.ts create mode 100644 packages/i18n/lib/enSymbolLabel.ts create mode 100644 packages/i18n/lib/zhSymbolLabel.ts diff --git a/packages/i18n/lib/__test__/enSymbolLabel.test.ts b/packages/i18n/lib/__test__/enSymbolLabel.test.ts new file mode 100644 index 0000000..135b913 --- /dev/null +++ b/packages/i18n/lib/__test__/enSymbolLabel.test.ts @@ -0,0 +1,10 @@ +import { enSymbolLabel } from '../enSymbolLabel' +import { describe, it, expect } from 'vitest' + +describe('enSymbolLabel', () => { + it('contains valid en symbol labels', () => { + Object.keys(enSymbolLabel).forEach((labelKey) => { + expect(typeof enSymbolLabel[labelKey]).toBe('string') + }) + }) +}) diff --git a/packages/i18n/lib/__test__/zhSymbolLabel.test.ts b/packages/i18n/lib/__test__/zhSymbolLabel.test.ts new file mode 100644 index 0000000..290b51d --- /dev/null +++ b/packages/i18n/lib/__test__/zhSymbolLabel.test.ts @@ -0,0 +1,10 @@ +import { zhSymbolLabel } from '../zhSymbolLabel' +import { describe, it, expect } from 'vitest' + +describe('zhSymbolLabel', () => { + it('contains valid zh symbol labels', () => { + Object.keys(zhSymbolLabel).forEach((labelKey) => { + expect(typeof zhSymbolLabel[labelKey]).toBe('string') + }) + }) +}) diff --git a/packages/i18n/lib/enSymbolLabel.ts b/packages/i18n/lib/enSymbolLabel.ts new file mode 100644 index 0000000..0e312c3 --- /dev/null +++ b/packages/i18n/lib/enSymbolLabel.ts @@ -0,0 +1,41 @@ +export const enSymbolLabel: Record = { + async: 'Async', + sync: 'Sync', + get: 'GET', + post: 'POST', + delete: 'DELETE', + put: 'PUT', + producer: 'Producer', + consumer: 'Consumer', + ns: 'nanosecond', + us: 'microsecond', + ms: 'millisecond', + s: 'second', + none: 'None', + base64: 'Base64', + json: 'JSON', + authentication_auth_gssapi_kerberos: 'Kerberos', + authentication_auth_username_password: 'Basic auth', + authentication_auth_basic: 'Basic auth', + authentication_auth_token: 'Token', + authentication_none: 'None', + parameters_connector_single: 'single', + parameters_connector_rs: 'rs', + parameters_connector_sharded: 'sharded', + parameters_redis_single_connector: 'single', + parameters_redis_sentinel_connector: 'rs', + parameters_redis_cluster_connector: 'sharded', + parameters_connector_influxdb_api_v_1: 'v1', + parameters_connector_influxdb_api_v_2: 'v2', + parameters_action_update: 'Update', + parameters_action_delete: 'Delete', + parameters_action_create: 'Create', + all_partitions: 'All Partitions', + plain: 'Plain', + scram_sha_256: 'SHA256', + scram_sha_512: 'SHA512', + m: 'minute', + h: 'hour', + d: 'day', + no_compression: 'No compression', +} diff --git a/packages/i18n/lib/index.ts b/packages/i18n/lib/index.ts index aff59ea..b9135e6 100644 --- a/packages/i18n/lib/index.ts +++ b/packages/i18n/lib/index.ts @@ -4,3 +4,5 @@ export * from './zhActionsLabel' export * from './enConnectorsLabel' export * from './zhConnectorsLabel' export * from './authHelpCodeMap' +export * from './enSymbolLabel' +export * from './zhSymbolLabel' diff --git a/packages/i18n/lib/zhSymbolLabel.ts b/packages/i18n/lib/zhSymbolLabel.ts new file mode 100644 index 0000000..a01a668 --- /dev/null +++ b/packages/i18n/lib/zhSymbolLabel.ts @@ -0,0 +1,41 @@ +export const zhSymbolLabel: Record = { + async: '异步', + sync: '同步', + get: 'GET', + post: 'POST', + delete: 'DELETE', + put: 'PUT', + producer: '生产者', + consumer: '消费者', + ns: '纳秒', + us: '微秒', + ms: '毫秒', + s: '秒', + none: 'None', + base64: 'Base64', + json: 'JSON', + authentication_auth_gssapi_kerberos: 'Kerberos', + authentication_auth_username_password: '基础认证', + authentication_auth_basic: '基础认证', + authentication_auth_token: 'Token', + authentication_none: '无', + parameters_connector_single: 'single', + parameters_connector_rs: 'rs', + parameters_connector_sharded: 'sharded', + parameters_redis_single_connector: 'single', + parameters_redis_sentinel_connector: 'sentinel', + parameters_redis_cluster_connector: 'cluster', + parameters_connector_influxdb_api_v_1: 'v1', + parameters_connector_influxdb_api_v_2: 'v2', + parameters_action_update: '更新', + parameters_action_delete: '删除', + parameters_action_create: '创建', + all_partitions: '所有分区', + plain: 'Plain', + scram_sha_256: 'SHA256', + scram_sha_512: 'SHA512', + m: '分钟', + h: '小时', + d: '天', + no_compression: '不压缩', +} diff --git a/packages/i18n/src/main.ts b/packages/i18n/src/main.ts index 3c49357..6dd4f56 100644 --- a/packages/i18n/src/main.ts +++ b/packages/i18n/src/main.ts @@ -4,6 +4,8 @@ import { zhActionsLabel, enActionsLabel, enConnectorsLabel, + zhSymbolLabel, + enSymbolLabel, } from '../lib' console.log( @@ -17,4 +19,8 @@ console.log( enActionsLabel, 'enConnectorsLabel', enConnectorsLabel, + 'zhSymbolLabel', + zhSymbolLabel, + 'enSymbolLabel', + enSymbolLabel, )