提交 bdd29116 编写于 作者: L LeoKu

chore: add locale

上级 58a53f13
...@@ -44,6 +44,7 @@ module.exports = { ...@@ -44,6 +44,7 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 0, '@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/consistent-type-imports': 1, '@typescript-eslint/consistent-type-imports': 1,
'@typescript-eslint/no-non-null-assertion': 0, '@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
}, },
ignorePatterns: [ ignorePatterns: [
'dist', 'dist',
......
...@@ -9,8 +9,22 @@ test('highlightJSON', () => { ...@@ -9,8 +9,22 @@ test('highlightJSON', () => {
expect(highlightJSON(str)).toMatch('string') expect(highlightJSON(str)).toMatch('string')
}) })
const getKeys = (target: Record<string, any>) => {
const keys: string[] = []
for (const key in target) {
if (typeof target[key] === 'object') {
keys.push(...getKeys(target[key]))
} else {
keys.push(key)
}
}
return keys
}
test('check locales completeness', () => { test('check locales completeness', () => {
const zh = Reflect.ownKeys(localeZH).sort() const zh = getKeys(localeZH).sort()
const en = Reflect.ownKeys(localeEN).sort() const en = getKeys(localeEN).sort()
expect(zh).toEqual(en) expect(zh).toEqual(en)
}) })
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
" "
class="color-picker" class="color-picker"
> >
<summary class="color">颜色</summary> <summary class="color">{{ t('label.colors') }}</summary>
<ul class="color-list"> <ul class="color-list">
<li <li
v-for="fillColor in SETTINGS.commonColors" v-for="fillColor in SETTINGS.commonColors"
......
...@@ -20,6 +20,7 @@ const props = defineProps<{ ...@@ -20,6 +20,7 @@ const props = defineProps<{
.section-title { .section-title {
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
font-weight: bold; font-weight: bold;
line-height: 23px;
} }
} }
</style> </style>
...@@ -26,7 +26,7 @@ import { ref, toRefs, watchEffect } from 'vue' ...@@ -26,7 +26,7 @@ import { ref, toRefs, watchEffect } from 'vue'
import { WrapperShape } from '@/enums' import { WrapperShape } from '@/enums'
import { type AvatarOption } from '@/types' import { type AvatarOption } from '@/types'
import { getRandomAvatarOption } from '@/utils' import { getRandomAvatarOption } from '@/utils'
import { AVATAR_LAYER, NONE, SETTINGS } from '@/utils/constant' import { AVATAR_LAYER, NONE } from '@/utils/constant'
import { widgetData } from '@/utils/dynamic-data' import { widgetData } from '@/utils/dynamic-data'
import Background from './widgets/Background.vue' import Background from './widgets/Background.vue'
......
...@@ -16,6 +16,7 @@ export default { ...@@ -16,6 +16,7 @@ export default {
label: { label: {
wrapperShape: 'Avatar Shape', wrapperShape: 'Avatar Shape',
backgroundColor: 'Background Color', backgroundColor: 'Background Color',
colors: 'colors',
}, },
widgetType: { widgetType: {
[WidgetType.Face]: 'Face', [WidgetType.Face]: 'Face',
......
...@@ -16,6 +16,7 @@ export default { ...@@ -16,6 +16,7 @@ export default {
label: { label: {
wrapperShape: '头像形状', wrapperShape: '头像形状',
backgroundColor: '背景颜色', backgroundColor: '背景颜色',
colors: '颜色',
}, },
widgetType: { widgetType: {
[WidgetType.Face]: '脸蛋', [WidgetType.Face]: '脸蛋',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册