mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
feat(i18n): 21-language pipeline, landing/docs/API wiring, landing+API translations
Shared Claude Code translation pipeline (scripts/i18n, no API key) plus Astro/VitePress/Scalar i18n wiring. Landing and API reference translated into all 20 languages; docs i18n wiring + English source anchors. The translated docs markdown (apps/docs/<locale>/**, 3,620 files) follows in a companion PR because it exceeds GitHub's per-PR CI file limit.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// scripts/i18n/adapters/registry.mjs
|
||||
// Single source of truth for surface adapters. Both translate.mjs and
|
||||
// check-parity.mjs import this so the surface list is defined once.
|
||||
// Surface plans (02-04) uncomment/add their entry as each adapter lands.
|
||||
export const ADAPTERS = {
|
||||
"landing-ui": () => import("./landing-ui.mjs"),
|
||||
"landing-seo": () => import("./landing-seo.mjs"),
|
||||
docs: () => import("./docs-md.mjs"),
|
||||
api: () => import("./api-spec.mjs"),
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} spec "all" or a comma list of surface keys
|
||||
* @returns {string[]} known surface keys
|
||||
*/
|
||||
export function resolveSurfaces(spec) {
|
||||
const keys = Object.keys(ADAPTERS);
|
||||
if (spec === "all") return keys;
|
||||
return spec
|
||||
.split(",")
|
||||
.map((s) => s.trim())
|
||||
.filter((k) => keys.includes(k));
|
||||
}
|
||||
Reference in New Issue
Block a user