Important
Since our locales are consolidated from different sources, they are managed through a separate process, please do not submit pull requests for localization files as they will not be accepted.
Thorium Web consolidates localization strings from two separate sources:
- Thorium Web - strings specific to this application
- Thorium Reader - strings shared across the Thorium suite
While Thorium Web strings are automatically PR’d by Weblate, Thorium Reader strings are manually updated and require coordination between the two projects.
Please do not submit pull requests for localization files as they will not be accepted. Translations are exclusively managed through Weblate projects where contributors can submit translations.
pnpm update-localesThis fetches the latest thorium-locales repository into a temporary directory, copies its shared locale files to public/locales/[locale]/thorium-shared.json, and generates a completion report. The resulting changes to public/locales should be reviewed and committed like any other change — this diff is the changelog for locale content, since thorium-locales itself isn't versioned.
public/locales is committed to the repository and consumed directly by the Next.js application build and the NPM package bundle — neither depends on thorium-locales at build time.
pnpm check-localesThis outputs a minimum viable report of the locales’ completion status in the terminal.
pnpm check-locales --show-missingThis shows missing translations for each locale.
pnpm check-locales --summaryThis creates locale-summary.txt at the project root with translation completion percentages and missing keys.
It checks completion twofold:
- It checks completion of all locales against English (reference locale)
- It checks which translation keys are actually used in the application code
The second check is called "inferred usage" but cannot be run automatically for all strings due to the customizability of the application, and the use of dynamic strings (a.k.a. template literals). These strings require manual review.
When updating locales, we run both options so that it can serve as a snapshot of the current state of the translation files.
The list of supported languages is maintained manually in src/i18n/supported-locales.ts.
There is currently no rule as to when languages should be dropped from or added to the supported list, but we review them periodically, on each release cycle.