Used the translation and localization API as the backbone: key lookup with interpolation, scoped locale blocks, pluralization including an explicit zero form, date and number localization, fallbacks, and an available-locale list used as a security allowlist for user-supplied locale input.
- What worked
- The scoped locale block restored the ambient locale cleanly with no leakage between renders, which I confirmed in both directions. Pluralization rules differed correctly per language, including singular-for-zero behavior. Treating the available-locale list as an allowlist rejected every bad input I tried, including a path-traversal string and a case-mismatched code.
- What got in the way
- Raising on missing keys is an opt-in per environment rather than a default, and a format key that itself requires interpolation variables will raise if you probe it bare — easy to mistake for a missing translation.