116 lines
4.1 KiB
JSON
116 lines
4.1 KiB
JSON
{
|
|
"phase": {
|
|
"id": "phase-1",
|
|
"name": "基础设施 — 安装 vue-i18n + 创建核心模块",
|
|
"description": "安装 vue-i18n 依赖,创建翻译核心模块(index.ts + zh-CN.ts),改造 main.ts 挂载 i18n",
|
|
"dependencies": [],
|
|
"tasks": [
|
|
{
|
|
"id": "1.1",
|
|
"name": "安装 vue-i18n 依赖",
|
|
"status": "pending",
|
|
"description": "通过 npm 安装 vue-i18n@9 并验证版本",
|
|
"files": {
|
|
"modify": ["package.json", "package-lock.json"]
|
|
},
|
|
"steps": [
|
|
{
|
|
"id": "1.1.1",
|
|
"action": "install",
|
|
"description": "安装 vue-i18n@9",
|
|
"runCommand": "cd everything-is-suitable-uniapp && npm install vue-i18n@9",
|
|
"expectedResult": "package.json 中出现 vue-i18n 依赖"
|
|
},
|
|
{
|
|
"id": "1.1.2",
|
|
"action": "verify",
|
|
"description": "验证安装版本",
|
|
"runCommand": "cd everything-is-suitable-uniapp && node -e \"const v = require('vue-i18n/package.json'); console.log(v.version)\"",
|
|
"expectedResult": "输出 9.x.x 版本号"
|
|
},
|
|
{
|
|
"id": "1.1.3",
|
|
"action": "commit",
|
|
"message": "chore: 安装 vue-i18n@9 依赖"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "1.2",
|
|
"name": "创建 zh-CN 主翻译源文件",
|
|
"status": "pending",
|
|
"description": "创建 src/locales/zh-CN.ts,包含 common/nav/almanac/ziwei/fortune/search/template/export/history 共 9 个命名空间约 80 个翻译键",
|
|
"files": {
|
|
"create": ["src/locales/zh-CN.ts"]
|
|
},
|
|
"steps": [
|
|
{
|
|
"id": "1.2.1",
|
|
"action": "write_implementation",
|
|
"description": "创建 zh-CN.ts 翻译源文件",
|
|
"translationNamespaces": ["common", "nav", "almanac", "ziwei", "fortune", "search", "template", "export", "history"],
|
|
"sourceRef": "设计规格翻译键清单"
|
|
},
|
|
{
|
|
"id": "1.2.2",
|
|
"action": "commit",
|
|
"message": "feat(i18n): 创建简体中文主翻译源 zh-CN.ts"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "1.3",
|
|
"name": "创建 locales/index.ts 核心模块",
|
|
"status": "pending",
|
|
"description": "创建 vue-i18n 实例、语言检测、切换、持久化逻辑",
|
|
"files": {
|
|
"create": ["src/locales/index.ts"]
|
|
},
|
|
"steps": [
|
|
{
|
|
"id": "1.3.1",
|
|
"action": "write_implementation",
|
|
"description": "创建 index.ts 核心模块,包含 createI18n/detectLocale/setLocale/getLocale/SUPPORTED_LOCALES/localeNames",
|
|
"exports": ["i18n", "setLocale", "getLocale", "SUPPORTED_LOCALES", "localeNames"],
|
|
"sourceRef": "设计规格核心模块设计"
|
|
},
|
|
{
|
|
"id": "1.3.2",
|
|
"action": "commit",
|
|
"message": "feat(i18n): 创建 vue-i18n 实例与语言检测/切换核心模块"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "1.4",
|
|
"name": "改造 main.ts 挂载 i18n",
|
|
"status": "pending",
|
|
"description": "在 main.ts 中导入 i18n 并通过 app.use() 挂载",
|
|
"files": {
|
|
"modify": ["src/main.ts"]
|
|
},
|
|
"steps": [
|
|
{
|
|
"id": "1.4.1",
|
|
"action": "write_implementation",
|
|
"description": "修改 main.ts:添加 import { i18n } from './locales' 和 app.use(i18n)",
|
|
"sourceRef": "设计规格 main.ts 改造"
|
|
},
|
|
{
|
|
"id": "1.4.2",
|
|
"action": "verify",
|
|
"description": "验证构建无报错",
|
|
"runCommand": "cd everything-is-suitable-uniapp && npx vite build --mode development 2>&1 | head -20",
|
|
"expectedResult": "构建成功,无模块解析错误"
|
|
},
|
|
{
|
|
"id": "1.4.3",
|
|
"action": "commit",
|
|
"message": "feat(i18n): 在 main.ts 中挂载 vue-i18n 实例"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|