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,22 @@
|
||||
// tests/unit/scripts/i18n/glossary.test.ts
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { buildSystemPrompt, DO_NOT_TRANSLATE } from "../../../../scripts/i18n/lib/glossary.mjs";
|
||||
|
||||
describe("glossary", () => {
|
||||
it("keeps the product name and format terms untranslated", () => {
|
||||
expect(DO_NOT_TRANSLATE).toContain("SnapOtter");
|
||||
expect(DO_NOT_TRANSLATE).toContain("WebP");
|
||||
});
|
||||
|
||||
it("builds a system prompt naming the target language and the rules", () => {
|
||||
const prompt = buildSystemPrompt("de");
|
||||
expect(prompt).toContain("German");
|
||||
expect(prompt).toContain("SnapOtter");
|
||||
expect(prompt).toMatch(/do not translate|keep.*unchanged/i);
|
||||
expect(prompt).toMatch(/⸤I18N/); // must warn about the token markers
|
||||
});
|
||||
|
||||
it("throws on an unknown locale so typos fail loudly", () => {
|
||||
expect(() => buildSystemPrompt("xx")).toThrow();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user