mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 21:39:54 +02:00
Now that the *.ko.mdx corpus exists, drop the temporary docsContentLang ko→en shim and the static-params fallback-synthesis loop so /docs/ko/* renders real Korean content. Korean is now a first-class locale whose params come straight from source.generateParams(). Also align the docs home hero copy (agent→에이전트) with the app and the translated body. MUL-2817 Co-authored-by: multica-agent <github@multica.ai>
42 lines
930 B
TypeScript
42 lines
930 B
TypeScript
import { i18n, type Lang } from "@/lib/i18n";
|
|
|
|
export type DocsStaticParam = {
|
|
lang: Lang;
|
|
slug: string[];
|
|
};
|
|
|
|
type SourceStaticParam = {
|
|
lang: string;
|
|
slug: string[];
|
|
};
|
|
|
|
function isLang(lang: string): lang is Lang {
|
|
return (i18n.languages as readonly string[]).includes(lang);
|
|
}
|
|
|
|
function paramKey(param: DocsStaticParam): string {
|
|
return `${param.lang}/${param.slug.join("/")}`;
|
|
}
|
|
|
|
export function docsSlugStaticParams(
|
|
params: SourceStaticParam[],
|
|
): DocsStaticParam[] {
|
|
const slugParams = params.filter(
|
|
(param): param is DocsStaticParam =>
|
|
param.slug.length > 0 && isLang(param.lang),
|
|
);
|
|
const output: DocsStaticParam[] = [];
|
|
const seen = new Set<string>();
|
|
|
|
const addParam = (param: DocsStaticParam) => {
|
|
const key = paramKey(param);
|
|
if (seen.has(key)) return;
|
|
seen.add(key);
|
|
output.push(param);
|
|
};
|
|
|
|
for (const param of slugParams) addParam(param);
|
|
|
|
return output;
|
|
}
|