Skip to content

Commit

Permalink
feat(i18n): add all dashbaord symbol labels
Browse files Browse the repository at this point in the history
  • Loading branch information
0721Betty authored and ysfscream committed Mar 7, 2024
1 parent f84c114 commit 9377340
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/i18n/lib/__test__/enSymbolLabel.test.ts
Original file line number Diff line number Diff line change
@@ -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')
})
})
})
10 changes: 10 additions & 0 deletions packages/i18n/lib/__test__/zhSymbolLabel.test.ts
Original file line number Diff line number Diff line change
@@ -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')
})
})
})
41 changes: 41 additions & 0 deletions packages/i18n/lib/enSymbolLabel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export const enSymbolLabel: Record<string, string> = {
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',
}
2 changes: 2 additions & 0 deletions packages/i18n/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export * from './zhActionsLabel'
export * from './enConnectorsLabel'
export * from './zhConnectorsLabel'
export * from './authHelpCodeMap'
export * from './enSymbolLabel'
export * from './zhSymbolLabel'
41 changes: 41 additions & 0 deletions packages/i18n/lib/zhSymbolLabel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
export const zhSymbolLabel: Record<string, string> = {
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: '不压缩',
}
6 changes: 6 additions & 0 deletions packages/i18n/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
zhActionsLabel,
enActionsLabel,
enConnectorsLabel,
zhSymbolLabel,
enSymbolLabel,
} from '../lib'

console.log(
Expand All @@ -17,4 +19,8 @@ console.log(
enActionsLabel,
'enConnectorsLabel',
enConnectorsLabel,
'zhSymbolLabel',
zhSymbolLabel,
'enSymbolLabel',
enSymbolLabel,
)

0 comments on commit 9377340

Please sign in to comment.