mirror of
https://github.com/Codennnn/vue-color-avatar.git
synced 2025-01-02 19:49:10 +00:00
chore: add locale
This commit is contained in:
parent
58a53f1373
commit
bdd2911665
@ -44,6 +44,7 @@ module.exports = {
|
||||
'@typescript-eslint/explicit-module-boundary-types': 0,
|
||||
'@typescript-eslint/consistent-type-imports': 1,
|
||||
'@typescript-eslint/no-non-null-assertion': 0,
|
||||
'@typescript-eslint/no-explicit-any': 0,
|
||||
},
|
||||
ignorePatterns: [
|
||||
'dist',
|
||||
|
@ -9,8 +9,22 @@ test('highlightJSON', () => {
|
||||
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', () => {
|
||||
const zh = Reflect.ownKeys(localeZH).sort()
|
||||
const en = Reflect.ownKeys(localeEN).sort()
|
||||
const zh = getKeys(localeZH).sort()
|
||||
const en = getKeys(localeEN).sort()
|
||||
expect(zh).toEqual(en)
|
||||
})
|
||||
|
@ -67,7 +67,7 @@
|
||||
"
|
||||
class="color-picker"
|
||||
>
|
||||
<summary class="color">颜色</summary>
|
||||
<summary class="color">{{ t('label.colors') }}</summary>
|
||||
<ul class="color-list">
|
||||
<li
|
||||
v-for="fillColor in SETTINGS.commonColors"
|
||||
|
@ -20,6 +20,7 @@ const props = defineProps<{
|
||||
.section-title {
|
||||
margin-bottom: 1.5rem;
|
||||
font-weight: bold;
|
||||
line-height: 23px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -26,7 +26,7 @@ import { ref, toRefs, watchEffect } from 'vue'
|
||||
import { WrapperShape } from '@/enums'
|
||||
import { type AvatarOption } from '@/types'
|
||||
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 Background from './widgets/Background.vue'
|
||||
|
@ -16,6 +16,7 @@ export default {
|
||||
label: {
|
||||
wrapperShape: 'Avatar Shape',
|
||||
backgroundColor: 'Background Color',
|
||||
colors: 'colors',
|
||||
},
|
||||
widgetType: {
|
||||
[WidgetType.Face]: 'Face',
|
||||
|
@ -16,6 +16,7 @@ export default {
|
||||
label: {
|
||||
wrapperShape: '头像形状',
|
||||
backgroundColor: '背景颜色',
|
||||
colors: '颜色',
|
||||
},
|
||||
widgetType: {
|
||||
[WidgetType.Face]: '脸蛋',
|
||||
|
Loading…
Reference in New Issue
Block a user