两个修复: 1. getObjectKeys 函数中 keys.add(key) 改为 keys.add(newKey),使点号分隔的 i18n key(如 menus.pureHome)能被正确翻译 2. VueI18nPlugin include 路径统一为 /,防止 Windows 反斜杠导致 YAML 资源文件匹配失败 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@@ -31,7 +31,7 @@ export async function getPluginsList(
// jsx、tsx语法支持
vueJsx(),
VueI18nPlugin({
- include: [pathResolve("../locales/**")]
+ include: [pathResolve("../locales/**").replace(/\\/g, "/")]
}),
/**
* 在页面上按住组合键时,鼠标在页面移动即会在 DOM 上出现遮罩层并显示相关信息,点击一下将自动打开 IDE 并将光标定位到元素对应的代码位置
@@ -50,7 +50,7 @@ function getObjectKeys(obj) {
if (obj[k] && isObject(obj[k])) {
stack.push({ obj: obj[k], key: newKey });
} else {
- keys.add(key);
+ keys.add(newKey);
}