fix(docs): localize the docs homepage, nav, and sidebar chrome across 20 languages (#547)

Localize the docs homepage (DocsHome.vue), top nav, and sidebar structural labels into all 20 non-English locales; individual tool names stay English by design. Also derive the homepage tool-count chips from the shared catalog via toolSection() so they no longer drift.
This commit is contained in:
SnapOtter
2026-07-17 09:18:26 +08:00
committed by GitHub
parent fe85dd2b98
commit 9247947704
5 changed files with 1937 additions and 49 deletions
File diff suppressed because it is too large Load Diff
+80 -9
View File
@@ -1,19 +1,95 @@
// apps/docs/.vitepress/i18n/ui.mjs
import { SUPPORTED_LOCALES } from "../../../../packages/shared/src/i18n/index.ts";
import { OVERRIDES } from "./overrides.mjs";
// Source strings (English). Other locales override keys as translations land;
// missing keys fall back to English via t().
// Source strings (English). Other locales override keys via ./overrides.mjs;
// missing keys fall back to English through t().
const EN = {
// DocsHome.vue
// DocsHome.vue - hero
"home.title": "SnapOtter Documentation",
"home.heroSub":
"Install, operate, and build on your self-hosted file-processing infrastructure. Get running in one command:",
"home.copy": "Copy",
"home.copied": "Copied!",
"home.clickToCopy": "Click to copy",
"home.copyCommandAria": "Copy command",
"home.fullInstallGuide": "Full install guide",
"home.gpuComposeSetup": "GPU & Compose setup",
"home.tryDemo": "Try the live demo",
// DocsHome.vue - doors
"home.selfHosting": "Self-hosting",
"home.selfHostingSub": "Get SnapOtter running and keep it healthy.",
"home.enterprise": "Enterprise",
"home.enterpriseSub": "Evaluate, secure & govern your deployment.",
"home.startSelfHosting": "Start self-hosting →",
"home.evaluate": "See enterprise features →",
// DocsHome.vue - self-hosting links
"home.link.quickStart": "Quick start",
"home.link.configuration": "Configuration",
"home.link.hardwareSizing": "Hardware & sizing",
"home.link.databaseBackups": "Database & backups",
"home.link.dockerTagsGpu": "Docker tags & GPU",
"home.link.supportedFormats": "Supported formats",
// DocsHome.vue - enterprise links
"home.link.architecture": "Architecture",
"home.link.securityHardening": "Security & hardening",
"home.link.ssoSamlOidc": "SSO · SAML · OIDC",
"home.link.scimProvisioning": "SCIM provisioning",
"home.link.usersRolesAudit": "Users, roles & audit",
"home.link.complianceSbom": "Compliance & SBOM",
// DocsHome.vue - modalities
"home.modalities": "200+ tools across 5 modalities",
"home.browseByType": "browse the full reference by type",
"home.mod.image": "Image",
"home.mod.video": "Video",
"home.mod.audio": "Audio",
"home.mod.pdf": "PDF",
"home.mod.files": "Files",
"home.toolsSuffix": "tools",
// DocsHome.vue - shared cards
"home.card.restApi": "REST API",
"home.card.restApiSub": "Keys, endpoints & OpenAPI",
"home.card.changelog": "Changelog",
"home.card.changelogSub": "What's new in 2.0",
"home.card.llmsTxt": "llms.txt",
"home.card.llmsTxtSub": "AI-friendly docs",
// Top nav (config.mts)
"nav.home": "Home",
"nav.guide": "Guide",
"nav.tools": "Tools",
"nav.apiReference": "API Reference",
"nav.changelog": "Changelog",
// Sidebar structural labels (config.mts). Individual tool names stay English;
// the acronym-only guide labels (OIDC / SSO, SAML SSO) are left untranslated.
"sidebar.cat.essentials": "Essentials",
"sidebar.cat.optimization": "Optimization",
"sidebar.cat.adjustments": "Adjustments",
"sidebar.cat.watermarkOverlay": "Watermark & Overlay",
"sidebar.cat.utilities": "Utilities",
"sidebar.cat.layout": "Layout",
"sidebar.cat.format": "Format",
"sidebar.cat.aiTools": "AI Tools",
"sidebar.sec.apiReference": "API reference",
"sidebar.sec.project": "Project",
"sidebar.page.imageEngine": "Image engine",
"sidebar.page.aiEngine": "AI engine",
"sidebar.guide.gettingStarted": "Getting started",
"sidebar.guide.architecture": "Architecture",
"sidebar.guide.configuration": "Configuration",
"sidebar.guide.scimProvisioning": "SCIM Provisioning",
"sidebar.guide.usersRolesPermissions": "Users, Roles & Permissions",
"sidebar.guide.database": "Database",
"sidebar.guide.upgrading": "Upgrading from 1.x",
"sidebar.guide.deployment": "Deployment",
"sidebar.guide.securityHardening": "Security & Hardening",
"sidebar.guide.telemetry": "What SnapOtter collects",
"sidebar.guide.supportedFormats": "Supported Formats",
"sidebar.guide.hardware": "Hardware requirements",
"sidebar.guide.dockerTags": "Docker tags",
"sidebar.guide.developer": "Developer guide",
"sidebar.guide.translations": "Translation guide",
"sidebar.guide.contributing": "Contributing",
"sidebar.editLink": "Edit this page on GitHub",
// FundButton.vue
"fund.label": "Fund Development",
// GitHubStars.vue
@@ -27,11 +103,6 @@ const EN = {
"notFound.link": "Back to docs",
};
// Per-locale overrides. Generated/refined by the pipeline in Plan 05; ships with
// English only, so t() returns English for every non-en locale until then.
/** @type {Record<string, Record<string, string>>} */
const OVERRIDES = {};
/**
* @param {string} locale
* @param {string} key
@@ -52,4 +123,4 @@ export function normalizeLocale(lang) {
return SUPPORTED_LOCALES.some((l) => l.code === code) ? code : "en";
}
export { SUPPORTED_LOCALES };
export { EN, SUPPORTED_LOCALES };