Internationalization
Интернационализация
It’s the work of making an application adaptable to different languages and regions. A prepared app can change its text, date and number formats, and writing direction without a separate interface for each market.
Also known as: i18n, l10n, локализация
Internationalization vs. localization
Internationalization (i18n) is the engineering and design work that makes an app adaptable. Localization (l10n) is the work of adapting it for a particular audience. In a checkout page, giving translators a complete order confirmation message with named placeholders is i18n. Writing the French Canadian version and reviewing it in the checkout flow is l10n.
What the frontend needs to handle
A locale identifies the language and can specify a region or script. en-US and en-GB both identify English, but their date conventions differ. Decide where the active locale comes from: a localized URL might take priority, while a saved preference or the browser’s language list can help choose a default.
Instead of embedding visible text in components, keep messages in catalogs and look them up by keys such as checkout.confirmOrder. Set a fallback policy for missing entries: for example, try fr-CA, then fr, then the product’s default language. Keep entire messages together so translators can move placeholders and account for grammar. English’s singular-versus-plural split is not universal; use locale-aware message rules rather than count === 1.
Keep dates and amounts as data until they need to be displayed. JavaScript’s Intl API handles locale-sensitive formatting, not translation. Locale also does not tell you which time zone an appointment uses or what currency a customer is being charged in.
Example: one event, two date formats
const event = new Date('2026-04-03T15:00:00Z');
const options = { dateStyle: 'short', timeZone: 'UTC' };
new Intl.DateTimeFormat('en-US', options).format(event); // 4/3/26
new Intl.DateTimeFormat('en-GB', options).format(event); // 03/04/2026
Both strings describe April 3 in UTC. Setting the time zone explicitly keeps the example from depending on the runtime’s local time zone. For an event shown in the viewer’s time zone, use that zone instead.
Layout and testing
A button that fits “Save” may not fit its translation. Try a pseudo-locale that expands and accents strings to catch clipped text and labels that bypass the catalog. Test a real right-to-left locale too: set the document’s dir and use CSS logical properties like padding-inline-start where spacing should follow the writing direction. Set lang as well so assistive technologies can pronounce the page correctly.
How it comes up in interviews
A common design question is how to add a language switcher to a server-rendered app. Explain how the selected locale is represented, which message bundles are loaded, and what happens when a key is missing. For hydration, the server and client need to agree on the initial locale, messages, and formatting settings: a date rendered in the server’s time zone can differ on the client even if the language matches.