Skip to content

增加中英文多语言的配置 #185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## version 2.16.1

- 增加中英文多语言的配置

## version 2.15.5

- 更改错误答案上色默认选项
Expand Down
131 changes: 0 additions & 131 deletions nls.js

This file was deleted.

98 changes: 0 additions & 98 deletions nls.json

This file was deleted.

6 changes: 6 additions & 0 deletions nls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,39 @@ function check_key(object, father: Array<any>) {
}

result_json[key] = object["description"];
object["description"] = `%${key}%`;
}
if (object["title"]) {
let key = main_join + ".title";
if (result_json[key]) {
console.log("重复", key);
}
result_json[key] = object["title"];
object["title"] = `%${key}%`;
}
if (object["name"]) {
let key = main_join + ".name";
if (result_json[key]) {
console.log("重复", key);
}
result_json[key] = object["name"];
object["name"] = `%${key}%`;
}
if (object["label"]) {
let key = main_join + ".label";
if (result_json[key]) {
console.log("重复", key);
}
result_json[key] = object["label"];
object["label"] = `%${key}%`;
}
if (object["enumDescriptions"]) {
let key = main_join + ".enumDescriptions";
if (result_json[key]) {
console.log("重复", key);
}
result_json[key] = object["enumDescriptions"];
object["enumDescriptions"] = `%${key}%`;
}
}

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

test();
Loading