You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -101,6 +116,8 @@ Each `content/category/slug.json` file has this structure:
101
116
102
117
## Category Display Names
103
118
119
+
Categories and their display names are defined in `html-generators/categories.properties`:
120
+
104
121
| ID | Display |
105
122
|----|---------|
106
123
|`language`| Language |
@@ -113,12 +130,59 @@ Each `content/category/slug.json` file has this structure:
113
130
|`datetime`| Date/Time |
114
131
|`security`| Security |
115
132
|`tooling`| Tooling |
133
+
|`enterprise`| Enterprise |
116
134
117
135
## Adding a New Pattern
118
136
119
137
1. Create `content/category/new-slug.json` with all required fields
120
138
2. Update `prev`/`next` in the adjacent patterns' JSON files
121
139
3. Run `jbang html-generators/generate.java`
140
+
4. (Optional) Create translated content files under `translations/content/{locale}/category/new-slug.json` with only translatable fields — or let the AI translation workflow handle it
141
+
142
+
## Internationalization (i18n)
143
+
144
+
The site supports multiple languages. See `specs/i18n/i18n-spec.md` for the full specification.
145
+
146
+
### Key Concepts
147
+
148
+
-**UI strings:** Hard-coded template text (labels, nav, footer) is extracted into `translations/strings/{locale}.yaml`. Templates use `{{dotted.key}}` tokens (e.g., `{{nav.allPatterns}}`, `{{sections.codeComparison}}`). Missing keys fall back to the English value with a build-time warning.
149
+
-**Content translations:** Translated pattern files under `translations/content/{locale}/` contain **only** translatable fields (`title`, `summary`, `explanation`, `oldApproach`, `modernApproach`, `whyModernWins`, `support.description`). All other fields (`oldCode`, `modernCode`, `slug`, `id`, `prev`, `next`, `related`, `docs`, etc.) are always taken from the English source.
150
+
-**Locale registry:**`html-generators/locales.properties` lists supported locales (format: `locale=Display name`). The first entry is the default.
151
+
-**English is a first-class locale:** All locales — including English — go through the same build pipeline.
152
+
-**Fallback:** If a pattern has no translation file for a locale, the English content is used and an "untranslated" banner is shown.
153
+
154
+
### Supported Locales
155
+
156
+
Defined in `html-generators/locales.properties`:
157
+
158
+
| Locale | Display Name |
159
+
|--------|-------------|
160
+
|`en`| English |
161
+
|`es`| Español |
162
+
|`pt-BR`| Português (Brasil) |
163
+
164
+
### Content Translation File Example
165
+
166
+
Translation files contain **only** translatable fields — no structural data:
0 commit comments