Skip to content

Internationalization and localization

Scope: making software and games ready for other languages and regions (internationalization), and translating and adapting them (localization), whatever the platform. The engine files name each engine's localization system: Unity, Godot and Unreal Engine. Adjustable text size and other accessibility settings for games are in Game development (GAMEDEV-18), and storing timestamps in PostgreSQL is PG-2 in PostgreSQL.

Entries are sorted by score from 1 to 10 (criteria): 9โ€“10 start here or strongly recommended, 6โ€“8 recommended, 1โ€“5 further reading or conditional.

Adopted references

  • 9 Unicode CLDR (Unicode Consortium): the standard repository of locale data, such as date, number, currency and unit formats, plural rules and sort order, used by all modern operating systems and browsers and by many programming languages.
  • 8 Globalization documentation (Microsoft Learn): the baseline: technology-independent guidance on internationalization, locales and formats, text and fonts, layout and mirroring, translation workflows and testing. Start with Design software for international markets, a world-readiness checklist for every feature.
  • 8 BCP 47 (IETF): language tags such as fr-CA or zh-Hant, and how to match them. HTTP Accept-Language, Windows locale names and Unreal Engine cultures, among others, use them.
  • 7 ICU User Guide (Unicode Consortium): the reference library for locale-aware formatting, message formatting, collation, text boundaries and time zones, built on CLDR data.
  • 7 Localization best practices for developers (Mozilla): how to write strings that translate well: string IDs, localization notes, placeholders, plural forms, no concatenation, no reused strings, and testing with pseudolocalization.
  • 7 Internationalization checklist (Microsoft Learn): what to validate for localizability, locale conventions and display. Use it in reviews.
  • 7 Authoring web pages (W3C Internationalization): techniques for character encodings, language declarations, bidirectional text and layout in HTML and CSS. Use it for web front ends.
  • 7 MessageFormat 2 (Unicode Consortium): the Unicode standard syntax for localizable messages with variables, plurals and markup, and the successor to ICU MessageFormat.

Key rules

Strings and messages

Encoding, formats and time

Layout, fonts and images

Testing and workflow

  • 7 I18N-14 Test with pseudo-localization from early in development: an automatic fake translation that accents each string, makes it about 40% longer and puts markers around it, plus a pseudo locale for formats. It shows hard-coded, joined and truncated text and missing glyphs before translation starts. (Microsoft, Pseudolocalization, Mozilla, Test localizability)
  • 5 I18N-15 Localize continuously: send new and changed strings to translation as soon as they're written, through an automated connection between the repository and the translation system, in a standard exchange format such as XLIFF. Localized versions are then ready, and can be tested, at the same time as the source version. (Microsoft, Continuous localization, Microsoft, Exchanging localizable resources)

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 6 Android Lint, SetTextI18n: flags string literals, concatenated text and numbers converted with toString() that are passed to TextView.setText. HardcodedText flags text written into layout files, and RtlHardcoded flags left and right where start and end belong. Run lint in CI with ./gradlew lint. Partly checks I18N-1, I18N-2, I18N-7 and I18N-11.
  • 6 FormatJS ESLint plugin: no-literal-string-in-jsx flags text and accessibility attributes in JSX that don't go through a message, and enforce-description requires a description for translators on every message. Partly checks I18N-1 and I18N-4.
  • 6 Stylelint, property-layout-mappings: set to flow-relative, it reports physical CSS properties such as margin-left and can fix them to logical ones such as margin-inline-start. Partly checks I18N-11.
  • 5 eslint-plugin-i18next, no-literal-string: flags string literals shown to users in React or Vue code that don't go through a translation function. Partly checks I18N-1.

Tutorials and further reading

  • 6 Character encodings: Essential concepts (W3C Internationalization): Unicode, character sets and encodings, characters and grapheme clusters, and characters and glyphs, explained for developers.
  • 6 Localize games (Microsoft Learn): what sets game localization apart: narrative and humour, voice recording and lip sync, age ratings, and cultural and geopolitical risks.