AI & Technology

Why Translated Localization Files Break Apps

Sep 23, 2026

Why Translated Localization Files Break Apps

Localisation files must remain valid for their real parser and runtime. Translate user-visible messages, preserve lookup identifiers and validate formatting arguments. PO is not simply a key/value file: msgid contains the source message used for lookup, msgstr the translation, and context or plural entries may also matter.

Format rules to check

YAML literal (|) and folded (>) blocks treat line breaks differently. Classic Java Properties.load(InputStream) uses Latin-1, while a Reader supplies its chosen encoding. RESX resource names are lookup identifiers. XLIFF inline codes carry formatting or other protected content. Validate each with its actual parser and runtime; visual proofreading alone misses these failures.

Validate before release

  1. Count placeholders in every source and target string — the multiset must match, even when the order does not.
  2. Diff the keys, not the values — any key present in the source and missing or renamed in the target is a bug.
  3. Load the translated file with the real parser (msgfmt, a YAML loader, ResXResourceReader) before shipping it.
  4. Check plural entries against the target language rule, not against the source language.
  5. Render the longest translation in the tightest UI element — text in other languages often runs longer than the English.

A repeated placeholder must remain repeated

With a template using {name} twice, the translation must also contain {name} twice unless the application’s formatting contract explicitly says otherwise. Compare the placeholder multiset, not merely a set or “once each”. Named or positional arguments can move for natural word order; anonymous %s arguments depend on sequence. Test the actual formatter, not just a text diff.

source: "{name}: {name}"
wrong: "{name}"
correct: "{name}: {name}"

1 файл | 2 файла | 5 файлов
11 файлов | 12 файлов | 14 файлов
21 файл | 22 файла
ProblemUseful response
Repeated {name} becomes a single tokenKeep the same occurrences and runtime contract
12 uses the form for 2Apply the 12–14 exception

Test the parser and real screens

Gettext Russian integer plurals use three forms: 1 файл, 2 файла, 5 файлов; 11, 12, 13 and 14 take файлов, despite their final digit. Test 1, 2, 5, 11, 12, 14, 21 and 22. This is a gettext example; do not assume the same rule implements ICU decimal categories. Parse the file, validate argument counts and render real screens before release.

GNU gettext: plural forms

Translate a locale file

Gettext Russian integer plurals use three forms: 1 файл, 2 файла, 5 файлов; 11, 12, 13 and 14 take файлов, despite their final digit.

Translate a locale file
How to translate CSV data safelyfeatured image

AI & Technology

How to translate CSV data safely

To translate CSV data safely, select the columns that contain human-readable text, keep identifiers and numeric fields u…

Profile picture of Amanda Lee

Amanda Lee