chore: tweak (#333)

This commit is contained in:
ntnyq authored and GitHub committed 2022-04-18 23:27:36 +08:00
1 parent 168fe35609
commit 225d10511e
2 files changed
+2 -5

No files matched your search

+1 -4
View File
@@ -8,10 +8,7 @@ import { type UserModule } from '~/types'
const messages = Object.fromEntries(
Object.entries(
import.meta.globEager('../../locales/*.y(a)?ml'))
.map(([key, value]) => {
const yaml = key.endsWith('.yaml')
return [key.slice(14, yaml ? -5 : -4), value.default]
}),
.map(([key, value]) => [key.split('/').at(-1)?.replace(/\.ya?ml$/, ''), value.default]),
)
export const install: UserModule = ({ app }) => {