mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(i18n): add Japanese language support
- Add complete Japanese translation file (ja.json) - Update frontend types and hooks to support "ja" language option - Add Japanese tray menu texts in Rust backend - Add Japanese option to language settings component - Update Zod schema to include Japanese language validation - Add test case for Japanese language preference - Update i18n documentation to reflect three-language support
This commit is contained in:
@@ -58,6 +58,29 @@ describe("useSettingsForm Hook", () => {
|
||||
expect(changeLanguageSpy).toHaveBeenCalledWith("en");
|
||||
});
|
||||
|
||||
it("should support japanese language preference from server data", async () => {
|
||||
useSettingsQueryMock.mockReturnValue({
|
||||
data: {
|
||||
showInTray: true,
|
||||
minimizeToTrayOnClose: true,
|
||||
enableClaudePluginIntegration: false,
|
||||
claudeConfigDir: "/Users/demo",
|
||||
codexConfigDir: null,
|
||||
language: "ja",
|
||||
},
|
||||
isLoading: false,
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useSettingsForm());
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.settings?.language).toBe("ja");
|
||||
});
|
||||
|
||||
expect(result.current.initialLanguage).toBe("ja");
|
||||
expect(changeLanguageSpy).toHaveBeenCalledWith("ja");
|
||||
});
|
||||
|
||||
it("should prioritize reading language from local storage in readPersistedLanguage", () => {
|
||||
useSettingsQueryMock.mockReturnValue({
|
||||
data: null,
|
||||
|
||||
Reference in New Issue
Block a user