Strings and languages
No translation plugin, no locale framework. Text sits on one of three rungs; knowing which is the whole discipline.
Declare the languages once
config.php lists the site’s languages, default first. Everything derives from that list: the maps data() recognises, the template folders, the /<lang>/ prefix the router strips, the alternate links in the sitemap. The default language has no prefix, and it must be on the list. Through the MCP the list only grows: a language that live data still carries cannot be dropped (strip those keys first), and the default language never changes — that is a migration CTXR handles.
The three rungs
An interface word — “Read more”, “Menu”, “Send” — is a key, not a literal. It lives in theme/strings/*.json as a language map and is read with locale_string('key'):
{ "nav.more": { "nl": "Lees verder", "en": "Read more" } }
All JSON files in strings/ are merged, so split them by concern; a locale_string() key may live in any of them, as long as it carries a default-language value. A key missing for the active language falls back along the chain (regional variant → base language → default); only a key missing in every language returns a visible sentinel. The audit reads the same merge the render does and reports coverage, so a forgotten translation is a finding, not a silent fallback; a key without its default-language value is flagged only in strings.json — the other files may carry engine-override keys that are English-floored in code. Where English is an acceptable floor — the engine’s own self-description texts, say — locale_string_or('key', 'Default', $vars) takes a code default and stays out of the audit.
A content field — name, description, body — is a language map inside the entity, picked on read; see Data in a template.
A whole section or page whose structure differs per language is its own file: a shell in templates/<lang>/ wins over the shared one in templates/ for that language (see how a page finds its shell), and a section can exist per language the same way. Use sparingly; most differences are content, not structure.
What falls back and what does not
Content falls back along the chain — a regional variant reads its base language, then the default; a base language reads the default — so a half-translated entity renders without holes. Existence does not fall back: a page exists in a language only if its slug map says so. A visitor always sees something coherent; you see at a glance what is not translated yet.
Formatting is the template’s job
Store dates, prices and numbers in machine form — "2026-06-12", plain numbers — because the machine views read the data. Format for humans on the way out, in functions.php. Never store "12 juni 2026".
The links between languages
locale_hreflang() returns the alternates the router computed from the slug map; seo_head() prints them as <link rel="alternate">. A visible language switch is the same list as links, offering only the languages this page exists in.