1.0.17 • Published 1 year ago
jpom-i18n v1.0.17
jpom 前端项目的国际化工具
// 创建配置
const contextConfig: ContextType = {
projectPath: "xxxx jpom前端工程",
// 根目录
globalPath: "src",
// 提取的文件夹
includeDir: ["pages"],
// 文件后缀
exts: [".vue"],
// 文件格式化配置
prettier: {
semi: false,
singleQuote: true,
endOfLine: "auto",
proseWrap: "never",
printWidth: 120,
trailingComma: "none",
},
lang: {
// 提取的语言文件
primaryFile: {
lang: "zh",
// 语言文件绝对路径
path: "/Users/**/*/i18n/locales/zh_cn.json",
},
// 同步的语言文件
syncFile: [
{
lang: "en",
// 语言文件绝对路径
path: "/Users/**/*/i18n/locales/en_us.json",
},
],
},
};
await i18nTools(contextConfig);