modelProviderCodingPlanI18n.test.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. import { describe, expect, it } from "vitest";
  2. import enUS from "../src/i18n/locales/en-US.js";
  3. import zhCN from "../src/i18n/locales/zh-CN.js";
  4. describe("model provider Coding Plan i18n", () => {
  5. it("keeps Coding Plan message ids localized in zh-CN", () => {
  6. const prefix = "settings.modelProvider.codingPlan";
  7. const enKeys = Object.keys(enUS).filter((key) => key.startsWith(prefix));
  8. for (const key of enKeys) {
  9. // Bugfix: Coding Plan 新增文案时只补了英文 locale,中文界面会直接显示 message id。
  10. // 这里用英文 key 集合作为基准,避免后续再漏掉中文翻译。
  11. expect(zhCN[key], `zh-CN missing ${key}`).toBeTruthy();
  12. }
  13. });
  14. it("keeps Z.ai payment copy in English without changing BigModel copy", () => {
  15. // Bugfix: Z.ai 海外支付文案需要独立于 BigModel,即使中文界面也保持英文。
  16. expect(zhCN["settings.modelProvider.codingPlan.overseasPayment.renewalPolicyTitle"]).toBe(
  17. "Renewal Policy",
  18. );
  19. expect(zhCN["settings.modelProvider.codingPlan.overseasPayment.accountPolicyTitle"]).toBe(
  20. "Account Usage Policy",
  21. );
  22. expect(zhCN["settings.modelProvider.codingPlan.overseasPayment.amount.payAmount"]).toBe(
  23. "Amount due",
  24. );
  25. expect(zhCN["settings.modelProvider.codingPlan.paymentDialog.payAmount"]).toBe("实付金额");
  26. expect(zhCN["settings.modelProvider.codingPlan.paymentDialog.ruleTitle"]).toBe(
  27. "账号使用规范",
  28. );
  29. });
  30. });