mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-08 01:24:31 +08:00
- 根据 VS Code 当前界面语言在英文和简体中文之间切换主要工具界面文本 - 实现配置验证消息的本地化支持,包括数组、标量、枚举等类型的错误提示 - 添加完整的 VS Code 扩展框架,支持配置文件浏览、验证和表单预览 - 实现批量编辑功能,支持对同一配置域内的多个 YAML 文件执行字段更新 - 集成诊断功能,在编辑器中显示配置验证错误和警告 - 提供树形视图展示配置目录结构和文件列表
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
const test = require("node:test");
|
|
const assert = require("node:assert/strict");
|
|
const {createLocalizer} = require("../src/localization");
|
|
|
|
test("createLocalizer should default to English strings", () => {
|
|
const localizer = createLocalizer("en");
|
|
|
|
assert.equal(localizer.languageTag, "en");
|
|
assert.equal(localizer.isChinese, false);
|
|
assert.equal(localizer.t("webview.button.save"), "Save Form");
|
|
assert.equal(
|
|
localizer.t("message.batchEditUpdated", {count: 2, domain: "monster"}),
|
|
"Batch updated 2 config file(s) in 'monster'.");
|
|
});
|
|
|
|
test("createLocalizer should switch to Simplified Chinese for zh languages", () => {
|
|
const localizer = createLocalizer("zh-cn");
|
|
|
|
assert.equal(localizer.languageTag, "zh-CN");
|
|
assert.equal(localizer.isChinese, true);
|
|
assert.equal(localizer.t("webview.button.save"), "保存表单");
|
|
assert.equal(
|
|
localizer.t("message.batchEditUpdated", {count: 2, domain: "monster"}),
|
|
"已在“monster”中批量更新 2 个配置文件。");
|
|
});
|