Skip to content

"Vibe-Trading: Your Personal Trading Agent"

fix(frontend): reconcile channel proxy and zh-CN i18n

Haozhe Wu041e1cf64385
diff --git a/frontend/src/__tests__/viteProxy.test.ts b/frontend/src/__tests__/viteProxy.test.ts
index 51573d86b..8bd2063f2 100644
--- a/frontend/src/__tests__/viteProxy.test.ts
+++ b/frontend/src/__tests__/viteProxy.test.ts
@@ -14,4 +14,4 @@ describe("Vite API proxy config", () => {
expect(config).toContain('"/settings/llm"');
expect(config).toContain('"/settings/data-sources"');
});
-});
\ No newline at end of file
+});
diff --git a/frontend/src/i18n/__tests__/i18n.test.ts b/frontend/src/i18n/__tests__/i18n.test.ts
index a2e29f09b..9a47162a9 100644
--- a/frontend/src/i18n/__tests__/i18n.test.ts
+++ b/frontend/src/i18n/__tests__/i18n.test.ts
@@ -3,7 +3,7 @@ import zhCN from "../locales/zh-CN.json";
import ja from "../locales/ja.json";
import ko from "../locales/ko.json";
import ar from "../locales/ar.json";
-import { SUPPORTED_LANGUAGES, isRtl } from "../index";
+import i18n, { SUPPORTED_LANGUAGES, isRtl } from "../index";
// ── helpers ────────────────────────────────────────────────────
@@ -140,4 +140,13 @@ describe("i18n utilities", () => {
const codes = SUPPORTED_LANGUAGES.map((l) => l.code);
expect(codes).toEqual(["en", "zh-CN", "ja", "ko", "ar"]);
});
+
+ it("accepts zh-CN as an explicit supported language", async () => {
+ await i18n.changeLanguage("zh-CN");
+
+ expect(i18n.language).toBe("zh-CN");
+ expect(i18n.languages).toContain("zh-CN");
+
+ await i18n.changeLanguage("en");
+ });
});
diff --git a/frontend/src/lib/__tests__/api.test.ts b/frontend/src/lib/__tests__/api.test.ts
index 2c7c7e3de..faa168536 100644
--- a/frontend/src/lib/__tests__/api.test.ts
+++ b/frontend/src/lib/__tests__/api.test.ts
@@ -39,4 +39,4 @@ describe("api request helper", () => {
message: expect.stringContaining("Expected JSON from /channels/status, got text/html"),
} satisfies Partial<ApiError>);
});
-});
\ No newline at end of file
+});
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 03ee4fef6..2a8a3a89a 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -13,8 +13,7 @@ const PROXY_PATHS = [
"/live",
"/upload",
"/shadow-reports",
- "/channels",
-]
+];
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), "");