Files
multica/apps/docs/lib/static-params.test.ts
Bohan Jiangandmultica-agent 920c3ea6d9 feat(docs): add French documentation aligned with UI terminology (MUL-7637) (#8757)
* docs(i18n): translate documentation corpus to French (MUL-7637)

Add French (.fr.mdx) translations for all 45 docs pages plus meta.fr.json
navigation, mirroring the English source. Product and UI terms follow the
in-app French locale at packages/views/locales/fr/ (issue -> tâche,
run -> exécution, autopilot -> automatisation, Chat -> Discussion,
Settings -> Paramètres, etc.). Status and role identifiers stay lowercase
English per the conventions glossary, with the French UI label shown once
where they are defined.

Co-authored-by: multica-agent <github@multica.ai>

* feat(docs): serve French docs locale (MUL-7637)

Register fr in the docs i18n config and add the French Fumadocs chrome,
language-switcher label, and home hero copy. Fumadocs maps fr to Orama's
built-in French tokenizer, so search needs no custom localeMap entry.

Co-authored-by: multica-agent <github@multica.ai>

* feat(i18n): link French UI to French docs (MUL-7637)

Route French users from the landing page, runtime guides, the autopilot
webhook filter help, and the Slack/Lark/DingTalk/Telegram setup links to
/docs/fr. The four integration tabs and the runtime helper each carried a
copy of the same locale-prefix ternary; they now share docsLocalePrefix.

Co-authored-by: multica-agent <github@multica.ai>

* fix(i18n): localize remaining docs entry points (MUL-7637)

French users still reached English docs from the Help menu, the Agents and
Skills "Learn more" links, and the landing footer. The views links now use
docsLocalePrefix; the landing dictionaries take the docs href from
docsHrefForLocale, so locales that reuse another dictionary (French reuses
English) still link to their own docs.

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: multica-agent <github@multica.ai>
2026-09-23 18:30:31 +08:00

51 lines
1.9 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { docsSlugStaticParams } from "./static-params";
// `source.generateParams()` hands back loosely-typed params (`lang: string`),
// so the inputs here mirror that shape — the `lang` strings are validated and
// narrowed by `docsSlugStaticParams` itself.
type RawParam = { lang: string; slug: string[] };
describe("docsSlugStaticParams", () => {
it("returns every localized slug page and drops the home param", () => {
// Each locale's pages come straight from `source.generateParams()` now
// that `*.ko.mdx` files exist — Korean is a first-class locale, not an
// English fallback. The only transform is dropping the empty-slug home
// param (rendered by `[lang]/page.tsx`, not the catch-all route).
const params: RawParam[] = [
{ lang: "en", slug: [] },
{ lang: "en", slug: ["agents"] },
{ lang: "en", slug: ["cli", "reference"] },
{ lang: "zh", slug: ["agents"] },
{ lang: "ko", slug: ["agents"] },
{ lang: "ko", slug: ["cli", "reference"] },
{ lang: "ja", slug: ["agents"] },
{ lang: "ja", slug: ["cli", "reference"] },
{ lang: "fr", slug: ["agents"] },
];
expect(docsSlugStaticParams(params)).toEqual([
{ lang: "en", slug: ["agents"] },
{ lang: "en", slug: ["cli", "reference"] },
{ lang: "zh", slug: ["agents"] },
{ lang: "ko", slug: ["agents"] },
{ lang: "ko", slug: ["cli", "reference"] },
{ lang: "ja", slug: ["agents"] },
{ lang: "ja", slug: ["cli", "reference"] },
{ lang: "fr", slug: ["agents"] },
]);
});
it("drops unknown languages and de-duplicates repeated params", () => {
const params: RawParam[] = [
{ lang: "ko", slug: ["agents"] },
{ lang: "ko", slug: ["agents"] },
{ lang: "de", slug: ["agents"] },
];
expect(docsSlugStaticParams(params)).toEqual([
{ lang: "ko", slug: ["agents"] },
]);
});
});