Files
solon/scripts/check-messages.ts
CatoandClaude Opus 5.5 ebcb85af72 feat(i18n): the start-a-business guide in eight languages; per-language pending lists for the messages check (#675)
* fix(i18n): check:messages leaves out each language's own pending namespaces

langkit's command line takes one --pending list for every language, but
Amend is pending only outside AMEND_LOCALES, so main failed check:messages
with 366 missing Amend keys in zh, ja and ko. scripts/check-messages.ts
calls langkit's checkMessages with a per-language map, read from
src/i18n/pending.ts, which the parity test now shares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

* feat(i18n): the start-a-business guide in all eight languages

The page's words are the StartBusiness messages (metadata too); the guide's
facts stay written once, in English, and read their other languages from
data/i18n/config.json by their English words. guideTexts() lists every
text the page can show from the guide files, for every country and
region, so pnpm run i18n:config finds them and the configuration test holds
each to every language. Official names keep their original (in brackets
where the English has them; as they are in German). The route counts as
translated. The title no longer hyphenates words that fit a 320px line.
Chinese, Japanese and Korean are machine translations, not yet read by a
native speaker, as for the rest of the site.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-02 03:12:31 +01:00

26 lines
1015 B
TypeScript

/**
* `pnpm run check:messages`: langkit's check of every message as ICU, with
* the pending namespaces of each language (src/i18n/pending.ts), the same
* ones the parity test leaves out. langkit's command line takes one list for
* every language; `Amend` is pending in some languages only.
*/
import { readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";
import { checkMessages, formatProblems } from "@bitbaum/langkit/check";
import { pendingFor } from "@/i18n/pending";
import { toLocale } from "@/i18n/routing";
const dir = "messages";
const tables = Object.fromEntries(
readdirSync(dir)
.filter((f) => f.endsWith(".json") && !f.startsWith("_"))
.map((f) => [f.slice(0, -".json".length), JSON.parse(readFileSync(join(dir, f), "utf8"))]),
);
const result = checkMessages({
source: "en",
tables,
pending: Object.fromEntries(Object.keys(tables).map((l) => [l, pendingFor(toLocale(l))])),
});
console.log(formatProblems(result));
if (!result.ok) process.exitCode = 1;