mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(i18n): add Traditional Chinese localization (#3093)
* Add Traditional Chinese localization * fix: address zh-TW formatting and token units - Format `zh-TW.json` with Prettier. - Use Traditional Chinese `萬` and `億` units for zh-TW token summaries. - Add usage formatting coverage for Traditional Chinese locale aliases. --------- Co-authored-by: Jason <farion1231@gmail.com>
This commit is contained in:
@@ -81,6 +81,29 @@ describe("useSettingsForm Hook", () => {
|
||||
expect(changeLanguageSpy).toHaveBeenCalledWith("ja");
|
||||
});
|
||||
|
||||
it("should support traditional chinese language preference aliases", async () => {
|
||||
useSettingsQueryMock.mockReturnValue({
|
||||
data: {
|
||||
showInTray: true,
|
||||
minimizeToTrayOnClose: true,
|
||||
enableClaudePluginIntegration: false,
|
||||
claudeConfigDir: "/Users/demo",
|
||||
codexConfigDir: null,
|
||||
language: "zh-Hant",
|
||||
},
|
||||
isLoading: false,
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useSettingsForm());
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.settings?.language).toBe("zh-TW");
|
||||
});
|
||||
|
||||
expect(result.current.initialLanguage).toBe("zh-TW");
|
||||
expect(changeLanguageSpy).toHaveBeenCalledWith("zh-TW");
|
||||
});
|
||||
|
||||
it("should prioritize reading language from local storage in readPersistedLanguage", () => {
|
||||
useSettingsQueryMock.mockReturnValue({
|
||||
data: null,
|
||||
|
||||
Reference in New Issue
Block a user