Appearance
How to add i18n in starter-kit
I18n has been implemented in the full version only. If you have started your project using the starter kit as per our suggestion, please follow the below steps to implement i18n functionality:
Copy
src/plugins/i18ndirectory from full version and paste it in starter kit. As plugins are auto-imported , there is no need to register plugin.Also, register
vite-plugin-vue-i18nin the vite config.tsimport VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' export default defineConfig({ AutoImport({ imports: [...,'vue-i18n'], vueTemplate: true, }), VueI18nPlugin({ runtimeOnly: true, compositionOnly: true, include: [ fileURLToPath(new URL('./src/plugins/i18n/locales/**', import.meta.url)), ], }), })Now enable
i18nin thethemeConfig.tsfile. You can find it in the root directory.tsenableI18n: true,We have successfully added
i18nto the starter-kit.