mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-06 14:40:01 +08:00
- add the 760 English keys missing from the French catalog and translate 229 values still copied from English\n- make a partner's empty reply language (Auto) follow the account model output language instead of hardcoding English\n- label Auto with the configured language and offer every supported response language in the picker\n- localize the Feishu thinking notice for every supported response language\n- add French catalog, picker and partner runtime regression tests
37 lines
958 B
TypeScript
37 lines
958 B
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { ensureLanguage, initI18n } from "@/i18n/init";
|
|
|
|
it("uses French copy now that the catalog is complete", async () => {
|
|
const i18n = initI18n("fr");
|
|
await ensureLanguage("fr");
|
|
await i18n.changeLanguage("fr");
|
|
|
|
expect(i18n.t("common.save")).toBe("Enregistrer");
|
|
});
|
|
|
|
it("uses English copy for a key missing from a partial locale", async () => {
|
|
const i18n = initI18n("en");
|
|
i18n.addResourceBundle(
|
|
"partial",
|
|
"app",
|
|
{ "common.cancel": "Annuler" },
|
|
true,
|
|
true,
|
|
);
|
|
await i18n.changeLanguage("partial");
|
|
|
|
expect(i18n.t("common.cancel")).toBe("Annuler");
|
|
expect(i18n.t("common.save")).toBe("Save");
|
|
|
|
i18n.removeResourceBundle("partial", "app");
|
|
});
|
|
|
|
it("uses Ukrainian copy when a translation exists", async () => {
|
|
const i18n = initI18n("uk");
|
|
await ensureLanguage("uk");
|
|
await i18n.changeLanguage("uk");
|
|
|
|
expect(i18n.t("common.save")).toBe("зберегти");
|
|
});
|