# mx-i18n-builder
**Repository Path**: xjpVips/mx-i18n-builder
## Basic Information
- **Project Name**: mx-i18n-builder
- **Description**: i18n国际化生成
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-11-21
- **Last Updated**: 2025-12-01
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### 使用说明
- html里面使用自定义标签
- js中采用注释的方案
- 确保不会影响原本页面的正常运行
1. 控制台执行
```shell
mx-i18n-builder --config ./i18n.config.json
```
2. 模板
- html
```html
张三
```
- js
```js
var obj = [];
obj[`运行时长`/*i18n-key=sft_front_js_login_loginError*/]=20;
var html = "远程控制";
$("#faswdfsadf").html(html)
var result = {
"retBool": true,
"msa": "测试",
"msg": "两次密码输入不一致"/*i18n-key=sft_front_js_login_loginError*/
}
console.log(obj)
console.log(html)
console.log(result)
LayerUtil.failMsg("登录失败"/*i18n-key=sft_front_js_login_loginError*/)
```
2. 配置文件
```json
{
"baseDir": ".",
"translateDirs": ["security","statics/js/custom","statics/js/library"],
"excludeDirs": ["dist","i18n"],
"excludeFiles": ["i18n.config.json","missing_security.txt"],
"outputDir": "./dist",
"langs": {
"zh": "./i18n/zh.json"
}
}
```
- baseDir 主目录
- translateDirs 要翻译的目录
- excludeDirs 排除的目录
- excludeFiles 排除的文件
- outputDir 输出目录
- langs 语言数量 以及对应的配置文件位置
- 中文.json 文件示例
```json
{
"name": "张三"
}
```