trilium/scripts/tsconfig.json
Elian Doran 5897d741bc
feat(website): offer every language Weblate reports as translated
The website picked its languages from a hand-maintained `LOCALES` array that
nothing checked, so it had fallen behind the `website` Weblate component. Thirteen
languages above the 50% bar the client uses were bundled but unreachable, German,
Indonesian, Korean and Irish among them at 100%, while Romanian at 54.9% was
offered. Add them, reusing the endonyms already curated in `packages/commons`.

`mapLocale()` ended in `locale.split('-')[0]`, which cannot express a locale that
carries a region: `en-GB`, `pt-BR` and `nb-NO` would have collapsed to `en`, a 5.1%
`pt` and a nonexistent `nb`. Resolve against `LOCALES` instead, preferring an exact
match, then the region-less entry for the language, then any region sharing it. A
bare `nb` or `pt` now reaches `nb-NO` or `pt-BR`, and a language the website does
not offer returns `en` rather than a locale with no entry in the picker. The
region-less step matters: `LOCALES` is sorted by display name, so without it
`en-US` resolves to `en-GB`.

`check-translation-coverage.ts` now gates the `website` component alongside
`client`, so the next language to cross the threshold fails CI instead of sitting
unreachable. It reports every missing locale rather than the first, and names the
file to add it to.

`LOCALES` moves to `apps/website/src/locales.ts` because the gate runs under tsx,
which cannot evaluate the `import.meta.glob` at the top of `i18n.ts`.

`en` is renamed to "English (United States)", matching `packages/commons`, since
"English" alongside "English (United Kingdom)" names nothing in particular.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 11:01:19 +03:00

26 lines
484 B
JSON

{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "bundler",
"target": "es2023",
"outDir": "dist",
"rootDir": "..",
"types": [
"node",
"express"
],
"tsBuildInfoFile": "dist/tsconfig.app.tsbuildinfo"
},
"include": [
"**/*.ts",
"**/*.mts",
"../packages/commons/src/lib/i18n.ts",
"../apps/website/src/locales.ts"
],
"exclude": [
"dist"
],
"references": []
}