i18n(site): convert Hugo i18n TOML->go-i18n JSON for Weblate

Weblate has no native Hugo-TOML format. The strings are already the go-i18n
structure ([key]/other=), so convert site/i18n/{en,es}.toml -> {en,es}.json
({"key":{"other":"..."}}) — Hugo 0.140 reads it identically (verified with the
pinned hugomods/hugo:exts-0.140.2 image). Enables a 'site' Weblate component.

Update TRANSLATIONS.md: site is now a component (go-i18n-json), not deferred.
This commit is contained in:
vjrj 2026-07-15 19:42:54 +02:00
parent f844d7c4f6
commit 0d4d19658c
5 changed files with 300 additions and 234 deletions

View file

@ -13,7 +13,7 @@ The links to the repo and to Weblate are shown both on the landing site
| Surface | Files | Format | Base locale | Locales today |
|---|---|---|---|---|
| **App** (`app` component) | `apps/app_seeds/lib/i18n/*.i18n.json` | JSON **nested** (slang, `{param}` placeholders) | `en` | en, es, pt, fr, de, ast, ja |
| **Site** (deferred) | `site/i18n/*.toml` | Hugo TOML | `en` | en, es |
| **Site** (`site` component) | `site/i18n/*.json` | **go-i18n JSON** (`{"key":{"other":"…"}}`) | `en` | en, es |
Only source strings live in git; app strings use `slang`, so `strings.g.dart` /
`strings_*.g.dart` are **generated** (see the slang caveat below).
@ -76,12 +76,24 @@ git add -A && git commit -m "chore(i18n): regenerate slang after Weblate sync"
regenerate. `fallback_strategy: base_locale` means locales missing a key show the
English text until translators fill it in.)
## Site component — deferred
## The `site` component (landing page)
Weblate 5.x has no native Hugo-TOML format, and the site has only EN/ES (~3 KB).
Two options, decide later:
- (a) Switch Hugo i18n to a Weblate-supported format (Hugo also reads
`i18n/*.json` / `*.yaml`), then add a matching `site` component.
- (b) Keep translating the two `site/i18n/*.toml` files by hand.
The Hugo landing strings live in `site/i18n/*.json`. Weblate has no native Hugo-TOML
format, so these were converted from TOML to **go-i18n JSON** (`{"key":{"other":"…"}}`)
— a shape Hugo 0.140 reads identically and Weblate supports natively. Component settings:
For now the site is translated manually; only the `app` component is on Weblate.
| Field | Value |
|---|---|
| Project | `tane` |
| Name / slug | `site` |
| Source code repository | *(link to the `app` component: `weblate://tane/app`)* |
| Repository branch | `main` |
| File mask | `site/i18n/*.json` |
| Monolingual base language file | `site/i18n/en.json` |
| Template for new translations | `site/i18n/en.json` |
| File format | **go-i18n JSON** (`go-i18n-json`) |
| Source language | English (`en`) |
Linking the repo to the `app` component (`weblate://tane/app`) shares one clone/token.
No slang step here — Hugo consumes the JSON directly. Only EN/ES today; adding a locale =
add `site/i18n/<code>.json`.