Skip to content

Commit e8728e8

Browse files
brunoborgesCopilot
andcommitted
Update i18n spec: content translation examples to YAML
Content translation files are YAML, not JSON. Updated the example, directory layout, and AI translation workflow references accordingly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fe248f0 commit e8728e8

File tree

1 file changed

+26
-21
lines changed

1 file changed

+26
-21
lines changed

specs/i18n/i18n-spec.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ translations/ # All i18n artifacts
4343
content/
4444
pt-BR/
4545
language/
46-
type-inference-with-var.json # Full translated JSON (all fields)
46+
type-inference-with-var.yaml # Translated YAML (translatable fields only)
4747
collections/
4848
strings/
4949
streams/
@@ -273,23 +273,28 @@ text is centrally managed and consistently translated.
273273

274274
Translation files contain **only** translatable fields — no structural data:
275275

276-
```json
277-
// translations/content/pt-BR/language/type-inference-with-var.json
278-
{
279-
"title": "Inferência de tipo com var",
280-
"oldApproach": "Tipos explícitos",
281-
"modernApproach": "Palavra-chave var",
282-
"summary": "Use var para deixar o compilador inferir o tipo local.",
283-
"explanation": "...",
284-
"whyModernWins": [
285-
{ "icon": "⚡", "title": "Menos ruído", "desc": "..." },
286-
{ "icon": "👁", "title": "Mais legível", "desc": "..." },
287-
{ "icon": "🔒", "title": "Seguro", "desc": "..." }
288-
],
289-
"support": {
290-
"description": "Amplamente disponível desde o JDK 10 (março de 2018)"
291-
}
292-
}
276+
```yaml
277+
# translations/content/pt-BR/language/type-inference-with-var.yaml
278+
title: Inferência de tipo com var
279+
oldApproach: Tipos explícitos
280+
modernApproach: Palavra-chave var
281+
summary: Use var para inferência de tipo em variáveis locais — menos ruído, mesma
282+
segurança.
283+
explanation: Desde o Java 10, o compilador infere os tipos de variáveis locais a partir
284+
do lado direito da atribuição. Isso reduz o ruído visual sem sacrificar a segurança
285+
de tipos. Use var quando o tipo for óbvio pelo contexto.
286+
whyModernWins:
287+
- icon: ⚡
288+
title: Menos boilerplate
289+
desc: Não é necessário repetir tipos genéricos complexos em ambos os lados da atribuição.
290+
- icon: 👁
291+
title: Melhor legibilidade
292+
desc: Foco nos nomes de variáveis e valores, não nas declarações de tipo.
293+
- icon: 🔒
294+
title: Ainda seguro em tipos
295+
desc: O compilador infere e impõe o tipo exato em tempo de compilação.
296+
support:
297+
description: Amplamente disponível desde o JDK 10 (março de 2018)
293298
```
294299

295300
---
@@ -469,18 +474,18 @@ New English slug → AI prompt → Translated JSON file → Schema validat
469474
2. **Translate** — For each supported locale, call the translation model with:
470475
```
471476
Translate the following Java pattern from English to {locale}.
472-
Return a JSON file containing ONLY these translated fields:
477+
Return a YAML file containing ONLY these translated fields:
473478
- title, summary, explanation, oldApproach, modernApproach
474479
- whyModernWins (full array with icon, title, desc)
475480
- support.description (inside a "support" object)
476481
Do NOT include: slug, id, category, difficulty, jdkVersion, oldLabel,
477482
modernLabel, oldCode, modernCode, docs, related, prev, next, support.state.
478-
Return valid JSON only.
483+
Return valid YAML only.
479484
```
480485
See the **Field Translation Reference** table above for the full rationale.
481486
3. **Validate** — Verify the output contains only translatable fields.
482487
4. **Commit** — Write the output to
483-
`translations/content/{locale}/<cat>/<slug>.json` and commit.
488+
`translations/content/{locale}/<cat>/<slug>.yaml` and commit.
484489
5. **Deploy** — The generator picks it up on next build; the "untranslated"
485490
banner disappears automatically.
486491

0 commit comments

Comments
 (0)