Your company is expanding from 3 languages to 25 locales over the next year, including Arabic and Hebrew (right to left), Japanese, German (long strings), and several locales with complex plural rules (Polish, Russian, Arabic). There are 18 web apps owned by 25 teams, plus iOS and Android apps, transactional emails and a marketing CMS.
Today strings are a mix of hard-coded English, a few JSON files per app, and string concatenation such as
"You have " + n + " items". Translations are emailed to an agency as spreadsheets.
Design a localization platform: how developers author messages, how strings are extracted and sent for translation, how translations are reviewed and delivered to apps (including without redeploying), the runtime SDK, formatting of dates/numbers/currencies, RTL support, quality checks in CI, and how you would roll it out across teams.
Localization at scale is mostly not a runtime problem. Rendering a translated string is easy. The hard parts are:
The platform's promise to a product team: write messages once in a standard format, get them translated and delivered automatically, and never ship a broken string.
pt-BR to pt to en).Intl (dates, numbers, currencies, lists, relative time, collation).Components:
strings.xml with
plurals) and emails.{
"id": "cart.summary.itemCount",
"namespace": "storefront/cart",
"defaultMessage": "{count, plural, =0 {Your cart is empty} one {You have # item} other {You have # items}}",
"description": "Cart header. count = number of distinct products in the cart.",
"screenshots": ["https://l10n.acme.internal/shots/cart-header.png"],
"maxLength": null,
"owner": "team-cart",
"tags": ["checkout", "tier1"]
}
description is required by lint: translators cannot translate "Close" correctly without knowing whether it is a
verb on a dialog or an adjective.
{
"id": "cart.summary.itemCount",
"locale": "pl",
"message": "{count, plural, =0 {Twój koszyk jest pusty} one {Masz # produkt} few {Masz # produkty} many {Masz # produktów} other {Masz # produktu}}",
"status": "reviewed",
"sourceHash": "a91f...",
"translatedBy": "vendor:linguist-17",
"updatedAt": "2025-05-30T12:00:00Z"
}
sourceHash ties a translation to the exact source text it translated. When English changes, existing translations
become stale, not deleted: the app keeps showing the old translation (usually still acceptable) until the new one
is reviewed, instead of falling back to English.
{
"app": "storefront",
"releasedAt": "2025-06-02T08:00:00Z",
"locales": {
"de": { "cart": "https://cdn.acme.com/i18n/storefront/de/cart.3be1c2.json",
"common": "https://cdn.acme.com/i18n/storefront/de/common.88aa01.json" },
"ar": { "cart": "https://cdn.acme.com/i18n/storefront/ar/cart.0c4d9e.json" }
},
"fallbacks": { "pt-BR": ["pt", "en"], "es-MX": ["es-419", "es", "en"] }
}
Bundles are split by namespace (roughly per route or feature) so a page loads only what it renders.
import { defineMessages, useT, FormattedMessage } from '@acme/i18n';
const m = defineMessages({
itemCount: {
id: 'cart.summary.itemCount',
defaultMessage: '{count, plural, =0 {Your cart is empty} one {You have # item} other {You have # items}}',
description: 'Cart header. count = number of distinct products in the cart.',
},
terms: {
id: 'cart.terms',
defaultMessage: 'By paying you accept our <link>terms</link>.',
description: 'Shown above the Pay button; link opens the terms page.',
},
});
function CartHeader({ count }: { count: number }) {
const t = useT('cart');
return (
<>
<h2>{t(m.itemCount, { count })}</h2>
<p><FormattedMessage {...m.terms} values={{ link: (chunks) => <a href="/terms">{chunks}</a> }} /></p>
</>
);
}
Generated types (from the catalog) make values type-checked: forgetting count is a compile error.
interface I18nRuntime {
locale: string; // negotiated BCP 47 tag, e.g. "pt-BR"
dir: 'ltr' | 'rtl';
loadNamespaces(ns: string[]): Promise<void>;
t<K extends MessageId>(id: K, values: MessageValues<K>): string;
formatNumber(n: number, opts?: Intl.NumberFormatOptions): string;
formatCurrency(amount: number, currency: string): string;
formatDate(d: Date, opts?: Intl.DateTimeFormatOptions): string;
formatRelativeTime(value: number, unit: Intl.RelativeTimeFormatUnit): string;
formatList(items: string[], opts?: Intl.ListFormatOptions): string;
compare(a: string, b: string): number; // Intl.Collator for sorting
}
acme-i18n extract --app storefront # finds defineMessages, validates ICU syntax, uploads to catalog
acme-i18n pseudo --locale en-XA # accented, 40% longer, bracketed strings
acme-i18n pull --app storefront --locales all # for local dev and builds
acme-i18n check # unused keys, missing descriptions, placeholder mismatches
CI on every PR: extraction succeeds, ICU syntax valid, descriptions present, no string literals in JSX text
(no-literal-string-style lint rule, with an allow-list for brand names), screenshot capture of changed stories for
translator context. On merge: new source strings are pushed to the catalog and the TMS automatically.
ICU MessageFormat is the de facto standard, supported by FormatJS (react-intl), i18next (via a plugin), Lingui,
and most TMSs. It handles plurals using CLDR rules, which matters: English has two plural categories, Polish and Russian
have four in practice (one, few, many, other), Arabic has six, Japanese has one. Concatenation and n === 1 ?
logic fail in most of the 25 locales.
Unicode MessageFormat 2 is the next-generation syntax (more extensible, better for tooling). Its specification
is now part of the Unicode LDML standard, and there is a TC39 proposal for Intl.MessageFormat, but library and TMS
support is still catching up. Recommendation: author in ICU MessageFormat today, keep messages in a parsed form in the
catalog so a later migration is mechanical.
| Option | Notes |
|---|---|
| FormatJS / react-intl | ICU-native, strong extraction tooling, precompilation to AST, wide adoption |
| i18next / react-i18next | Huge ecosystem, flexible backends and namespaces; its default format is not ICU (plurals via key suffixes) unless you add the ICU plugin |
| Lingui | ICU-based with macros, compile-time extraction, small runtime |
| Next.js-specific (next-intl) | Good App Router and Server Components integration, ICU-based |
| In-house runtime | Only the thin wrapper; never write your own ICU parser |
Pick one org-wide, wrap it in @acme/i18n so the dependency can be swapped. FormatJS or Lingui fit best with a
strictly ICU pipeline; next-intl is a good inner layer for Next.js apps behind the same facade.
Buy. Phrase, Lokalise, Crowdin, Smartling and Transifex all provide translation memory, glossaries, MT integration, review workflows, vendor management and APIs. What you build is the catalog service and pipeline glue, which keeps the vendor replaceable and gives one integration instead of 25.
Hybrid recommendation: the build embeds the source locale and a snapshot of translations at build time (so nothing is ever missing); at runtime, the SDK checks the manifest and, if a newer bundle exists for the current locale, loads it on the next navigation. For SSR, the server loads bundles from the manifest and inlines the needed namespaces into the HTML, so there is no flash of untranslated content.
Resolution order: requested locale, then its fallback chain, then the snapshot from build, then the defaultMessage
in code. A formatting error in a translation (invalid ICU) falls back to the next level and is reported to telemetry
with message ID and locale. The compile step should catch these before publish, but runtime defence is still needed.
<html lang="ar" dir="rtl"> server-side from the negotiated locale.margin-inline-start, padding-inline-end, inset-inline-start)
so layouts mirror automatically. A lint rule (stylelint) flags physical properties like margin-left in new code.<bdi> or
unicode-bidi: isolate around user-generated and interpolated values.Use Intl everywhere: Intl.NumberFormat for currencies (never place symbols manually; de-DE writes 1.234,56 €),
Intl.DateTimeFormat with explicit time zones, Intl.RelativeTimeFormat, Intl.ListFormat, Intl.PluralRules for
custom cases, and Intl.Collator for sorting names. Cache formatter instances; constructing them repeatedly is
expensive. Be careful with SSR hydration: server and client must use the same locale and time zone, or rendered
dates mismatch. Pass the user's time zone explicitly rather than relying on the server's.
Priority: explicit user preference (account setting), then URL (/de/... for SEO-relevant pages, with hreflang
links), then cookie, then Accept-Language. Do not auto-redirect based on IP geolocation alone; a German speaker in
France should not be forced into French. Separate language from region/market (prices, payment methods):
en language with DE market is valid.
de, ar and ja in visual regression.maxLength) for tight UI such as buttons and push notifications.Precompile messages to an AST at publish time so the runtime does not ship an ICU parser (FormatJS and Lingui both support this). Split bundles by namespace, load the route's namespaces in parallel with its code, and cache bundles immutably. Typical savings: tens of KB of parser plus a fraction of messages per route.
defineMessages, migration of JSON
files into the catalog with ID mapping, and a dashboard of remaining hard-coded strings per app.de, fr, es, ja) launched app by app behind a flag per locale.ar and he per app with native-speaker QA.t(): catalog, context for translators, staleness via source
hashes, automated validation.Should message IDs be semantic keys or hashes of the English text?
Semantic keys (cart.summary.itemCount) are stable when English copy changes and readable in code review; hash-based
IDs (generated from text and description) remove naming effort but change when copy changes. For a large org with a
TMS, semantic IDs plus source hashes for staleness give the best of both.
How do you handle a translation that breaks the layout?
Prevent with maxLength and pseudo-locale testing; design components to wrap and truncate gracefully with full text
available (tooltip or expanded view); fix the specific string in the TMS and ship via OTA.
How do you localize content from the CMS or user-generated content? CMS content has its own localization workflow (the CMS integrates with the TMS directly). User-generated content is usually not translated, or is translated on demand by machine translation with a clear "translated" label.
What about SEO for localized pages?
Locale in the URL path, server-rendered translated content, hreflang alternates and a localized sitemap; never rely
on client-side language switching for indexable pages.
How do you avoid shipping all 25 locales in every bundle?
Only the active locale's namespaces are loaded at runtime; Intl data is built into browsers, so locale data
polyfills are needed only for very old environments.
Spotted a mistake or a rights concern? Report an issue