Skip to content

Lesson 9 of 9 · 25m

Operating Localized Systems in Production

Ship catalogs incrementally, validate ICU data in CI, monitor missing translations, and keep runtime behavior consistent across deployments.

The painful localization incidents are usually operational: a malformed ICU message deploys and renders raw syntax, one locale falls back to English for half the settings page, or a CDN keeps serving an old catalog beside a new JavaScript bundle. Localization is not finished when translation returns. It is runtime data with versioning, validation, caching, and observability like any other production dependency.

Treat catalogs as versioned runtime data

Messages ship with application code or through a content pipeline. Either way, they need compatibility rules. If a new bundle expects checkout.total.v2 but the CDN still serves yesterday's French catalog, the UI needs a controlled fallback — not a crash:

function formatMessageSafe(intl, id, values) {
  if (!(id in intl.messages)) reportMissingMessage(id, intl.locale);
  const message = id in intl.messages ? { id } : defaultMessages[id] ?? { defaultMessage: id };
  return intl.formatMessage(message, values);
}

Fallback policy should be deliberate. Source-language fallback is often better than showing a raw key, but security-critical copy may need stricter deployment ordering.

Validate before release

CI should parse every catalog, compile ICU messages, compare placeholders, and verify locale-specific plural categories. A representative check might load catalogs and compile them:

node scripts/check-messages.mjs   --source locales/en.json   --locales locales/*.json   --fail-on missing-placeholder,invalid-icu,unknown-plural-category

Warnings and failures need separation. Missing translation coverage may be a warning for a beta locale but a failure for a fully supported locale. Make that policy explicit rather than arguing during incidents.

Cache by exact artifact, not wishful thinking

Message catalogs are ideal cache keys when content-addressed:

/locales/fr/app.9f21d4c.json
/locales/ar/app.9f21d4c.json

Immutable hashes avoid the classic split-brain deploy where application code and catalogs disagree. If you use unversioned keys such as /locales/fr.json, cache invalidation must be coordinated with application deployment and rollback.

Measure production reality

Useful telemetry includes resolved locale, fallback locale used, missing message IDs, catalog load failures, formatting exceptions, and language-switcher events. Sample or aggregate carefully because locale itself can be sensitive in combination with other identifiers. You do not need message content in telemetry to diagnose pipeline defects.

i18n.missing_message{id="billing.invoice.download",locale="fr",version="2026.11.30"}
i18n.catalog_load_error{locale="pt-BR",artifact="app.9f21d4c"}

Rollback is a localization event

Rolling back application code without rolling back catalogs can resurrect old placeholders or missing keys. Rolling back catalogs without code can restore messages no component still uses. Define whether catalogs are tightly coupled to application versions or independently compatible. Both models can work; ambiguity cannot.

Keep CLDR and platform dependencies current

ICU and CLDR updates change plural edge cases, locale names, formatting details, and segmentation behavior. Usually that is good. Occasionally it breaks snapshot tests or user expectations. Upgrade deliberately, run locale-sensitive tests, and avoid pinning production behavior to whatever random system locale library happened to be installed in the container.

Field notes

  • Raw keys in production UI usually mean lookup happened before catalogs loaded or a key rename was not backward-compatible.
  • Translating error messages does not remove the need for stable machine-readable error codes.
  • Email, PDF, server-rendered pages, and worker jobs need the same resolved-locale discipline as the web UI.
  • Do not let translation coverage metrics measure only key count. Untranslated high-traffic copy matters more than obscure admin strings.

Was this lesson helpful?

Sign in to rate