Localization
Adapting the product for other languages and regions.
Localization covers translation, formats for dates and currency, text length and cultural expectations. It needs engineering support from the start, such as string extraction and flexible layouts. Retrofitting it later is expensive.
Why it matters for a product engineer
Localization adapts a product to another language and region: the words, the formats for dates and money, the length of text and what people expect. Most of the work is engineering that must exist before the first translation: strings outside the code, layouts that grow, and the language marked in the HTML. Adding these later is expensive.
How to do it
- Keep every user-facing string in a dictionary per language from the first release, never in the components.
- Mark the language with
langon thehtmlelement, and link translations withhreflang. - Use logical CSS properties, such as
margin-inline-start, so the layout works in any direction. - Format dates, numbers and prices with the platform’s locale tools, not by hand.
- Leave room for longer text. German words are long, and accents need line height. Never put text inside images.
- Write each language natively for its market, and have a native speaker review it in the product.
Common mistakes
- Concatenated strings, such as “You have “ + n + “ items”, that do not work in other grammars.
- Fixed-width buttons that cut off translated labels.
- A word-for-word translation that sounds wrong to a native speaker.
- Reviewing only the source language before release.
Example
RelievApp’s first market is Spain. The briefs for two new versions asked for Spanish copy written natively, with informal “tú”, not a word-for-word translation of English lines such as “pop your stress.” Each version stores its copy as an overlay per language. An agent’s first audit did not review the Spanish copy at all. A second pass did, and noted: “Spanish reads naturally.” (RelievApp in In practice)
Physical and logical CSS properties
| margin-left | margin-inline-start | |
|---|---|---|
| In English | Left side | Left side |
| In Arabic or Hebrew | Still the left side | Right side |
| In vertical Japanese | Still the left side | Top |
| Stylesheets needed | One per direction | One for all |
A logical property follows the flow of the text. The same stylesheet then works for translations in any writing direction.
Reportedweb.dev, Internationalization
Resources
1- courseStart here
Internationalization ↗
web.dev (Google) · 2021 · 7 minLayout choices that survive other languages and writing directions, such as logical CSS properties.
Tools
1- ToolFreemium