chore: revert i18n handling, close #337

This commit is contained in:
Anthony Fu 2022-04-21 20:42:12 +08:00
parent 4c5b6babbd
commit 47c6604602

View File

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