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/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', () => {
|
|||||||
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 @@
|
|||||||
"
|
"
|
||||||
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<{
|
|||||||
.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'
|
|||||||
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 {
|
|||||||
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 {
|
|||||||
label: {
|
label: {
|
||||||
wrapperShape: '头像形状',
|
wrapperShape: '头像形状',
|
||||||
backgroundColor: '背景颜色',
|
backgroundColor: '背景颜色',
|
||||||
|
colors: '颜色',
|
||||||
},
|
},
|
||||||
widgetType: {
|
widgetType: {
|
||||||
[WidgetType.Face]: '脸蛋',
|
[WidgetType.Face]: '脸蛋',
|
||||||
|
Loading…
Reference in New Issue
Block a user