Skip to content

Commit cf5642a

Browse files
committed
增加中英文多语言的配置
1 parent a10b4ba commit cf5642a

10 files changed

+199
-441
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## version 2.16.1
2+
3+
- 增加中英文多语言的配置
4+
15
## version 2.15.5
26

37
- 更改错误答案上色默认选项

nls.js

Lines changed: 0 additions & 131 deletions
This file was deleted.

nls.json

Lines changed: 0 additions & 98 deletions
This file was deleted.

nls.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,39 @@ function check_key(object, father: Array<any>) {
1313
}
1414

1515
result_json[key] = object["description"];
16+
object["description"] = `%${key}%`;
1617
}
1718
if (object["title"]) {
1819
let key = main_join + ".title";
1920
if (result_json[key]) {
2021
console.log("重复", key);
2122
}
2223
result_json[key] = object["title"];
24+
object["title"] = `%${key}%`;
2325
}
2426
if (object["name"]) {
2527
let key = main_join + ".name";
2628
if (result_json[key]) {
2729
console.log("重复", key);
2830
}
2931
result_json[key] = object["name"];
32+
object["name"] = `%${key}%`;
3033
}
3134
if (object["label"]) {
3235
let key = main_join + ".label";
3336
if (result_json[key]) {
3437
console.log("重复", key);
3538
}
3639
result_json[key] = object["label"];
40+
object["label"] = `%${key}%`;
3741
}
3842
if (object["enumDescriptions"]) {
3943
let key = main_join + ".enumDescriptions";
4044
if (result_json[key]) {
4145
console.log("重复", key);
4246
}
4347
result_json[key] = object["enumDescriptions"];
48+
object["enumDescriptions"] = `%${key}%`;
4449
}
4550
}
4651

@@ -83,6 +88,7 @@ async function test() {
8388
let ob = JSON.parse(temp_data);
8489
print_obj(ob, ["main"]);
8590
await fse.writeFile("./nls.json", JSON.stringify(result_json));
91+
await fse.writeFile("./package.json", JSON.stringify(ob));
8692
}
8793

8894
test();

0 commit comments

Comments
 (0)