Skip to content
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
11 changes: 11 additions & 0 deletions src/core/__tests__/i18n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ describe("i18n", () => {
// then.
expect(i18n.language).toBe("zh_CN");
});

it("should map to simplified Chinese without region", async () => {
// given.
jest.spyOn(window.navigator, "language", "get").mockReturnValue("zh");

// when
const i18n = (await import("../i18n")).default;

// then.
expect(i18n.language).toBe("zh_CN");
});
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class Internationalization {
}

// Chinese Simplified
if (language === "zh-Hans" || language === "zh-CN") {
if (language === "zh" || language === "zh-Hans" || language === "zh-CN") {
return "zh_CN";
}

Expand Down