A lot of progress
All checks were successful
Build and Deploy Nuxt / build (push) Successful in 36s

This commit is contained in:
2026-04-28 00:20:15 +02:00
parent b928212608
commit 76bb9fbb30
38 changed files with 382 additions and 460 deletions

View File

@@ -0,0 +1,33 @@
import { createI18n } from 'vue-i18n'
function loadLocaleMessages() {
const locales = import.meta.glob('../../i18n/locales/**/*.json', { eager: true })
const messages: Record<string, any> = {}
for (const path in locales) {
console.log(path);
const matched = path.match(/i18n\/locales\/(\w+)\/(.*)\.json$/)
if (!matched) continue
const [, locale, file] = matched
if (!messages[locale]) {
messages[locale] = {}
}
messages[locale][file] = (locales[path] as any).default
}
console.log(messages);
return messages
}
export default defineNuxtPlugin((nuxtApp) => {
const i18n = createI18n({
legacy: false,
locale: 'en',
messages: loadLocaleMessages()
})
nuxtApp.vueApp.use(i18n)
})