feat(i18n): 更新国际化组件,优化语言文件和结构,增强类型支持
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 1m16s
/ depcheck (push) Successful in 1m36s
/ playwright (push) Successful in 2m49s

This commit is contained in:
严浩
2024-11-07 15:26:33 +08:00
parent 3eed9a44df
commit 6b657f3f2b
7 changed files with 57 additions and 73 deletions

View File

@ -3,8 +3,8 @@ import { unheadVueComposablesImports } from '@unhead/vue';
import { VantResolver } from '@vant/auto-import-resolver';
import Vue from '@vitejs/plugin-vue';
import VueJsx from '@vitejs/plugin-vue-jsx';
import { dirname } from 'node:path';
import { fileURLToPath, resolve, URL } from 'node:url';
import path from 'node:path';
import { fileURLToPath, URL } from 'node:url';
import UnoCSS from 'unocss/vite';
import { type ImportsMap } from 'unplugin-auto-import/types';
import AutoImport from 'unplugin-auto-import/vite';
@ -145,7 +145,14 @@ function Plugins() {
VueI18nPlugin({
/* options */
// locale messages resource pre-compile option
include: resolve(dirname(fileURLToPath(import.meta.url)), './path/to/src/locales/**'),
include: [path.resolve(__dirname, './src/locales/**')],
// https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#transformi18nblock
// transformI18nBlock(src) {
// console.debug(`src :>> `, src);
// console.debug(`typeof src :>> `, typeof src);
// return src as string;
// },
}),
);