Pseudo-Localization: Testing i18n Before Translation

Pseudo-Localization: Testing i18n Before Translation

A fake locale that still reads as English exposes hardcoded strings, concatenation, clipping, and encoding bugs before any translator works. How to wire it, and its limits.

Pseudo-localization turns the source catalog into a fake locale that a developer can still read but that exaggerates every property real locales will have. Each transformation exposes a defect class: accented letters expose encoding and font problems, padding exposes truncation and clipping, bracket delimiters expose hardcoded and concatenated strings, and preserved placeholders expose interpolation done outside the message layer. Wired as a first-class locale in development and CI, it is a gate that runs before any translation work begins. It is also a structural test only, and this article is explicit about what it cannot verify.

Testing translation-readiness without translations

A structural i18n defect found after translation, such as a hardcoded string or a concatenated sentence, costs a translation round trip per locale. A hardcoded English string discovered in the German build has to be extracted into the catalog, sent to translators for German, and, because the defect is in the code rather than the German, for every other locale too. A concatenated sentence discovered in the Japanese build has to be rewritten as a single message, which invalidates the fragments already translated in every language.

Pseudo-localization finds that class of structural defect with zero translators involved. That is the economic argument, and it is a strong one: the defects it catches are the ones whose cost multiplies by the number of locales, and it catches them while the fix is still one change in one codebase.

Precisely, pseudo-localization is a machine transformation of the source catalog into a fake locale. The Microsoft globalization documentation and the Lingui pseudolocalization guide describe the same core idea: take each source message, apply transformations that mimic the properties of real translations, and render the product in that fake locale.

The design point that makes it work is readability. "Account settings" becomes something like "[Àççôûñţ šéţţîñĝš one two]", still legible to anyone on the team. Engineers, designers, and QA can navigate the whole product in the pseudo-locale as easily as in English, which means the whole product is testable by anyone, not only by people who read the target languages.

Scope for this article: the harness and the defect classes it exposes. The layout rules that fix what padding reveals belong to text-expansion work, and per-locale human review of real translations remains its own later stage.

The transformation, defect by defect

The transformations are only useful if each one is mapped to the defect class it is designed to expose. That mapping is the spine of the technique.

TransformationWhat it doesDefect class it exposes
Accented substitutionSwaps Latin letters for accented equivalentsEncoding, font coverage, and normalization bugs
Length paddingInflates each message, more for short stringsTruncation, clipping, and crushed layouts
Bracket delimitersWraps every message in start and end markersHardcoded strings and concatenated fragments
Placeholder preservationLeaves interpolation tokens untouchedInterpolation done outside the message layer

Accented substitution exposes the encoding path end to end. If any layer between the catalog and the screen mishandles non-ASCII text, the result is mojibake, the garbled character sequences of a wrong encoding, and it shows up immediately rather than in a production locale. Fonts without diacritic coverage fall back to a different face for some letters, which is visible as uneven text. Normalization bugs, where a precomposed accented letter and its decomposed equivalent compare as different strings, surface in search and sorting.

Length padding mirrors the expansion reality documented by the W3C's text size in translation guidance, where, for text translated from English into European languages, source strings of up to 10 characters average two to three times their length (W3C, citing IBM's guidelines). Microsoft's globalization guidance gives a heuristic for English source text of lengthening it by 40 percent, while noting that in practice there can be extreme cases where a string may be 200 percent or even 400 percent longer when translated into a real language. It also notes that strings of one or two words commonly grow proportionally longer than strings with more words, so pad short strings proportionally more. Clipped buttons, overflowing tabs, and table headers crushing their columns all appear before any real long language arrives.

Bracket delimiters catch the two classic sins. A string on screen without brackets never entered the catalog: it is hardcoded. A sentence whose brackets close partway through is assembled from fragments: "[Ŝĥôŵîñĝ] 5 [ôƒ] 20 [ŕéšûļţš]" is three messages concatenated around numbers, and its word order cannot be translated correctly into languages that arrange those parts differently.

Placeholder preservation is a rule of the transformer rather than a transformation: {name} and {count} pass through untransformed. A rendered pseudo-string with a mangled or missing placeholder reveals that interpolation happened outside the message layer, usually string concatenation in a component that bypassed the formatter.

A before-and-after catalog fragment makes the transformation concrete:

json
{
  "cart.summary": "You have {count, plural, one {# item} other {# items}} in your cart",
  "profile.greeting": "Welcome back, {name}"
}
json
{
  "cart.summary": "[Ýôû ĥàṽé {count, plural, one {# îţéɱ} other {# îţéɱš}} îñ ýôûŕ çàŕţ one two three]",
  "profile.greeting": "[Ŵéļçôɱé ƀàçķ, {name} one two]"
}

Note what the transformer leaves alone: the placeholder names, the plural keywords, and the # token stay exactly as written, because transforming message syntax would test a broken message rather than the code around it.

Reading a pseudo-localized screen becomes a quick visual scan once the mapping is familiar. Plain English with no accents and no brackets is a hardcoded string, and the fix is extracting it into the catalog. Accented text with brackets that open and close several times within one visual sentence is concatenation, and the fix is merging the fragments into one message with placeholders. Text cut off mid-word, or a closing bracket that never appears, is clipping or truncation, and the fix lives in the component's layout. Boxes, question marks, or a visibly different typeface for some letters point at the font stack or the encoding path. A raw {name} on screen, or a value with no surrounding message at all, means interpolation happened somewhere the message layer never saw. Each symptom points to one owner, which is what makes the screen actionable rather than merely ugly.

The RTL pseudo-locale, honestly scoped

A second pseudo-locale wraps transformed text in right-to-left markers and sets the document direction to RTL. Its job is narrow: smoke-testing that layout direction responds to the locale at all. Components that stay visually left-to-right under the RTL pseudo-locale have hardcoded directionality, usually physical CSS properties such as margin-left or icons positioned with absolute left offsets.

The boundary goes in immediately. This is a smoke test, not RTL correctness. Real bidirectional behavior, governed by the Unicode Bidirectional Algorithm (UAX #9), mirroring policy, and the layout quality of Arabic and Hebrew interfaces belong to the RTL literature, and a passing pseudo-RTL run does not certify an RTL launch. Mixed-direction text, numbers inside RTL sentences, and icon mirroring judgments all need real content and people who read it.

The smoke test still earns its place because the defects it catches are cheap now and expensive later. Physical properties scattered through a component library are a small fix while the library is young and a large retrofit when an RTL market decision finally arrives.

Wiring it as a first-class locale

The architectural decision that matters most: the pseudo-locale goes through the same pipeline as real locales. It is generated from the source catalog at build time, selectable through the same locale switcher, reachable through the same routing, and loaded through the same fallback chain. A special-cased "pseudo mode", for example a global flag that transforms strings at render time inside the formatter, tests the special case rather than the system. It skips the catalog loading path, the routing, and the fallback behavior, which are exactly the places where real locales fail.

There are two legitimate ways to generate the pseudo-catalog:

  • Library-provided support, where the team's i18n stack already ships a pseudo-locale or a pseudo-localization option. Several widely used message-formatting toolchains do, as of Nov 2026, though option names and defaults vary by version and should be checked in the current docs.
  • A small build-step transformer over the source catalog. It needs to parse the message syntax so it can leave placeholders and plural keywords intact, which in practice means using the same message parser the runtime uses rather than regular expressions.

The core of a build-step transformer is small once the parser does the hard part. The sketch below assumes a parser that returns literal text segments and syntax nodes separately, with each plural, selectordinal, or select node holding its branches as nested messages, which is how ICU message syntax defines them. It leaves out plural offsets, and it uses a shortened accent table and a single padding rule, so its output is plainer than the examples above and its padding can differ from them by a word:

typescript
const ACCENTS: Record<string, string> = { a: "à", c: "ç", e: "é", i: "î", o: "ô", u: "û", n: "ñ", s: "š", t: "ţ" };
const PAD = ["one", "two", "three", "four", "five"];

function pseudoText(text: string): string {
  return [...text].map((ch) => ACCENTS[ch] ?? ch).join("");
}

function pseudoBody(segments: Segment[]): string {
  return segments
    .map((s) => {
      if (s.kind === "literal") return pseudoText(s.value);
      // Plural, selectordinal, and select branches are nested messages: keep the keywords, transform the branch text.
      if (s.kind === "plural" || s.kind === "selectordinal" || s.kind === "select") {
        const branches = s.branches.map((b) => `${b.key} {${pseudoBody(b.message)}}`).join(" ");
        return `{${s.arg}, ${s.kind}, ${branches}}`;
      }
      // Placeholders such as {name} and the # token pass through untouched.
      return s.raw;
    })
    .join("");
}

function pseudoMessage(segments: Segment[], sourceLength: number): string {
  const padWords = Math.max(1, Math.ceil(sourceLength * (sourceLength < 20 ? 0.1 : 0.04)));
  return `[${pseudoBody(segments)} ${PAD.slice(0, Math.min(padWords, PAD.length)).join(" ")}]`;
}

The padding formula is a deliberately rough starting point, not a standard: for strings longer than 20 characters it adds less than the 40 percent heuristic above. Tune it so short labels inflate noticeably more than long sentences, which is the shape the expansion data describes.

Either way the output is an ordinary catalog file for a locale code reserved for the purpose. Use a well-formed code that will never describe a real language or locale, such as a language subtag from the private-use range qaa through qtz or a private-use region subtag such as XA, rather than an otherwise unused real code. Microsoft's globalization guidance records why: its early Windows pseudo-locale, tk-TM, collided with a real locale when the next Windows release shipped tk-TM, and the collision caused many bugs. The code should also be stable and documented.

Where it runs: always available in development builds, so engineers switch to it while building a feature rather than after. In CI, it runs as a rendering pass, for example by pointing the team's existing end-to-end or screenshot harness at the pseudo-locale for a set of key routes. The mechanics of visual suites, such as baselines, thresholds, and diff review, belong to visual-regression testing practice; at this layer the point is simply that the pseudo-locale is one more locale the harness already knows how to render.

The pseudo-locale is build tooling. It is stripped from production locale lists, excluded from sitemaps and language switchers, and never routable on the public site.

What pseudo-localization cannot verify

The honest-limits ledger is not optional, because the technique is easy to oversell.

It cannot judge linguistic quality. Translation accuracy, terminology, tone, per-locale conventions, and cultural fit are all invisible to a machine transformation of English. Real script rendering is invisible too: CJK line metrics, Arabic letter shaping, and line breaking in complex scripts are not exercised by accented Latin. Structural readiness is not linguistic readiness.

It exercises only what renders from the catalog. Strings born in backend services, transactional emails, generated PDFs, and error paths stay untested unless the pseudo-catalog reaches those surfaces too. Coverage follows the catalog's reach. An API returning English error messages that the frontend displays verbatim will show those messages without brackets, which is the harness correctly flagging them, but only if someone triggers the error path while in the pseudo-locale.

It does not verify message grammar. Pseudo-localization proves that a plural message renders. It does not prove that the branch structure is right for languages with more plural categories than English, which is a message-authoring concern, and it does not replace syntax validation of catalogs in CI.

Seen together, the limits clarify what pseudo-localization is for. It is the harness that makes the other i18n disciplines checkable: keys instead of hardcoded strings, layouts with real capacity, interpolation inside the message layer, and catalogs that load through the same path in every locale. It is a gate, not a substitute for translation review or real-locale testing, and teams that treat it as the first gate rather than the only one get its full value.

Project Inquiry