Skip to content

Commit 4b2330d

Browse files
Copilotbrunoborges
andcommitted
docs: specify per-key English fallback with WARN logging for missing string keys
Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 9c2ff55 commit 4b2330d

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

specs/i18n/i18n-spec.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,15 @@ need to include keys that differ from English.
168168
}
169169
```
170170

171-
Missing keys fall back to `en.json` at build time.
171+
**Key-level fallback rule:** if a key present in `en.json` is absent from a
172+
locale file, the generator uses the English value and emits a build-time warning:
173+
174+
```
175+
[WARN] strings/pt-BR.json: missing key "footer.builtWith" — using English fallback
176+
```
177+
178+
The page is always rendered completely; no key is ever silently blank. The warning
179+
is purely informational and does **not** abort the build.
172180

173181
---
174182

@@ -229,6 +237,9 @@ For each pattern and locale the generator:
229237
- **No** → use the English file and inject an "untranslated" banner
230238
(see next section).
231239
3. Loads `translations/strings/<locale>.json` deep-merged over `en.json`.
240+
Any key present in `en.json` but absent from the locale file falls back to
241+
the English value; the generator logs a `[WARN]` for each missing key and
242+
continues without aborting.
232243
4. Renders the template, substituting content tokens (`{{title}}`, …) and
233244
UI-string tokens (`{{nav.allPatterns}}`, …).
234245
5. Writes output to `site/<locale>/<cat>/<slug>.html`

0 commit comments

Comments
 (0)