sr's census found item-noun="country", item-noun-plural="countries" and unit="UPG" passed as literals. All three reach the DOM: PosterWall renders the noun pair at its section count (n === 1 ? itemNoun : plural) and the unit beside each row's count, so in Arabic the chrome translated and these stayed English. The noun pair now goes through t(). Country and Countries were already in the catalogue in all eleven locales -- Land/Länder, الدولة/الدول, Страна/Страны -- so this adds no strings, and PosterWall keeps making its own singular/plural choice with the caller supplying both forms, which is what its props are for. unit stays "UPG" on purpose. It is DX-life's term of art, and their own Arabic common.json carries the literal "UPG" rather than translating it; matching them is the point of the port. It is the one entry the census still reports here. A fourth literal the census did not flag went with them: the prayer-list "Coming soon" sentence, which reaches exportState.message and so renders too. That one had no key, so it lands as an English-source key -- the convention useRegionsI18n exists to serve -- translated in all eleven locales, 77 keys each, parity green. MEASURED, this plugin's entries in check:hardcoded-english: 3 before, 1 after. |
||
|---|---|---|
| .. | ||
| locales | ||
| index.js | ||
| README.md | ||
| useRegionsI18n.js | ||
library/i18n/ — the map's translations
One of the three customization seams (colors/, api/, i18n/). This one owns every
user-facing string. Translations are one folder per locale, one JSON file per area, inlined at
build time into a Vue I18n instance (one per <doxa-map>, so embeds don't bleed state).
i18n/
┌───────────────────────────────┐
│ index.js ← engine, don't edit │
│ locales/ │
│ en/ buttons.json legend.json …│ ← en is the source of truth + fallback
│ es/ ar/ zh/ … (same keys) │ ← 11 shipped locales, drop in your own
└───────────────────────────────┘
filename → namespace: buttons.json → $t('buttons.prayForThem')
- 11 shipped locales;
arrenders right-to-left (RTL_LOCALES). - Add a language by copying
locales/en/tolocales/<code>/— never by editingindex.js(except adding the code toSUPPORTED_LOCALES). - Missing keys fall back to English silently.
Adding or overriding a locale? The full contract (locale matrix, checklist, integration) is in ../../documentation/architecture/i18n.md.