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,13 @@
|
||||
// scripts/i18n/lib/hash.mjs
|
||||
import { createHash } from "node:crypto";
|
||||
|
||||
/**
|
||||
* Stable 12-char hex hash of a source string.
|
||||
* CRLF is normalized to LF so line-ending changes never trigger re-translation.
|
||||
* @param {string} text
|
||||
* @returns {string}
|
||||
*/
|
||||
export function hash(text) {
|
||||
const normalized = String(text).replace(/\r\n/g, "\n");
|
||||
return createHash("sha256").update(normalized, "utf8").digest("hex").slice(0, 12);
|
||||
}
|
||||
Reference in New Issue
Block a user