mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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.
22 lines
851 B
TypeScript
22 lines
851 B
TypeScript
// Build-time per-section tool counts for the docs homepage chips. Derived from
|
|
// the shared TOOLS catalog via toolSection() so the numbers never drift (the
|
|
// project's single-source-of-truth rule for per-section counts). Runs in Node
|
|
// during the VitePress build; only the resulting numbers reach the client.
|
|
import { defineLoader } from "vitepress";
|
|
import { TOOLS } from "../../../../packages/shared/src/constants.ts";
|
|
import { type Section, toolSection } from "../../../../packages/shared/src/section.ts";
|
|
|
|
export type SectionCounts = Record<Section, number>;
|
|
|
|
declare const data: SectionCounts;
|
|
|
|
export { data };
|
|
|
|
export default defineLoader({
|
|
load(): SectionCounts {
|
|
const counts: SectionCounts = { image: 0, video: 0, audio: 0, pdf: 0, files: 0 };
|
|
for (const tool of TOOLS) counts[toolSection(tool)]++;
|
|
return counts;
|
|
},
|
|
});
|