Skip to content

Optional analytics, session recording and advertising stay off unless you accept. You can reject them and use Transglot. Change your choice anytime in Cookie preferences. Cookie Policy

Back to the blog
Terminology & QA

Localization Testing: The Complete Guide (2026)

A full localization testing reference: pseudo-localization, static checks, layout and right-to-left tests, Intl logic, linguistic review, with code.

by transglot team
published November 24, 2026
32 min read

Documentation reviewed 23 November 2026.

Quick answer

Localization testing checks that a product works and reads correctly in every language and region it ships in. It has three parts: internationalization testing (can the code handle any locale), functional localization testing (does each locale work) and linguistic testing (is the text right). Most of it can be automated in layers: static checks on the translation files, unit tests on formatting logic, screenshot and clipping tests in a browser, and a short end-to-end run per locale. Start with pseudo-localization, because it finds hardcoded strings, concatenation and truncation before any translation exists. Meaning, tone and cultural fit still need a native speaker reading the text in the product.

Who this guide is for

This guide is for QA leads and engineers who own the quality of a product in more than one language. For the process that comes before testing, read the software localization guide.

At the end you will have:

  • A test pyramid for localization, with what each layer catches and costs.
  • A script that pseudo-localizes a JSON file without breaking placeholders or ICU syntax.
  • A static checker for keys, placeholders, ICU syntax, plural forms, length and forbidden terms.
  • Playwright tests that run per locale, compare screenshots and detect clipped text.
  • Unit tests for dates, time zones, numbers, currency, sorting, search and Unicode input.
  • A linguistic bug report template, severity levels and a review score.

Every script was run on Node.js 22.15. Details are in "How this guide was checked".


Part 1: three kinds of testing

The terms are often used as synonyms. They test different things and are run by different people.

Internationalization testingLocalization (functional) testingLinguistic testing
Short formi18n testingl10n testing, localization QALQA, linguistic review
QuestionCan the code handle any language and region?Does the product work in this locale?Is the text correct and natural in this language?
TestsThe code, with no real translation neededThe built product, in each localeThe translated text, in context
Typical defectsHardcoded strings, concatenated sentences, fixed widths, hand-built dates, layouts that do not mirrorClipped text, untranslated screens, wrong currency or date, broken input, wrong sort orderWrong meaning, wrong term, grammar, tone, a correct word in the wrong place
Who runs itEngineers, in CIQA, mostly automatedA native speaker
WhenFrom the first commitEvery build and releasePer release, on changed and high-traffic text
Needs to know the languageNoNo, for most of itYes

The split follows the W3C definitions: internationalization makes a product localizable, localization adapts it to one market. An internationalization defect appears in every language and is fixed once in code. A localization defect appears in one locale. A linguistic defect is fixed in the translation.

Classify every localization bug as one of the three before assigning it. A clipped button sent to a translator comes back as a worse, shorter translation. The fix was in the CSS.
Rule

Part 2: the localization test pyramid

Run the cheapest test that can catch a defect. A missing placeholder can be found in a JSON file in milliseconds. In a browser it takes minutes, and in production it takes a support ticket.

LayerWhat it catchesRun byWhenCost
1. Static file checksMissing and extra keys, lost placeholders, invalid ICU syntax, missing plural forms, over-length strings, forbidden termsA script in CIEvery commitSeconds, no browser
2. Unit testsWrong date, number, currency and plural logic, wrong sorting, Unicode handlingThe test runnerEvery commitSeconds
3. Visual and layout testsClipping, overlap, layouts that do not mirror, missing glyphsA browser with a pseudo-locale and a few real localesEvery pull request or nightlyMinutes per locale, plus baseline upkeep
4. End-to-end per localeFlows that break in one locale only: sign-up with a non-Latin name, checkout with a decimal commaBrowser or device automationA subset per commit, all nightlyMinutes per locale per flow
5. Human linguistic reviewMeaning, tone, terminology in context, cultural fitA native speakerPer releaseHours of a person
A cream paper-pulp stepped pyramid of five tiers on a dark stone plinth, widest at the bottom, with a small teal glass figure on the top tier
Five layers: the wide ones are cheap and run on every commit

Two existing posts go deeper on single layers and are not repeated here. Automated localization QA covers which checks can run without a person. React localization CI checks builds a dependency-free checker for i18next catalogs and wires it into GitHub Actions.


Part 3: pseudo-localization

What it is

Pseudo-localization replaces every source string with an altered copy that is still readable in the source language. Microsoft's globalization documentation describes it as a way to verify that a product is localizable without localizing it into a real language. You run the product in the pseudo-locale and look at it. Nobody needs to speak another language.

The transformations

TransformationExample for "Save"What it reveals
AccentsŠávéText without accents is hardcoded, or comes from somewhere your files do not reach. Also shows encoding and font problems
ExpansionŠávé oneTruncation and overlap, before a long language arrives
Brackets[Šávé one]A missing closing bracket means the string was cut. Two bracket pairs in one sentence mean it was concatenated
Right-to-left mirroringCharacters reversed, layout mirroredElements that do not mirror, misplaced punctuation, mixed-direction bugs

How much to expand: Microsoft suggests 40% as a heuristic for English source text and notes that strings of one or two words grow proportionally more. W3C's article on text size gives averages from IBM: strings of up to 10 characters expand by 200 to 300%, strings over 70 characters by about 130%. The script below doubles strings of up to 10 letters and adds 40% to the rest.

A script that protects placeholders and ICU syntax

A naive script accents every letter, including {count, plural, one {...}}, and produces messages that fail at render time. This one copies placeholders, ICU keywords, selectors, printf tokens and HTML tags unchanged, and transforms only the text a user reads.

No dependencies. Works on flat and nested JSON. Run on Node.js 22.15js
// pseudo.mjs: node pseudo.mjs locales/en.json locales/en-XA.json [--bidi]
import { readFileSync, writeFileSync } from "node:fs";
const [input, output, flag] = process.argv.slice(2);
const bidi = flag === "--bidi";
const ACCENTS = {
a: "á", b: "ƀ", c: "ç", d: "ð", e: "é", g: "ĝ", h: "ĥ", i: "î", j: "ĵ",
k: "ķ", l: "ļ", n: "ñ", o: "ö", r: "ŕ", s: "š", t: "ţ", u: "ü", w: "ŵ",
y: "ý", z: "ž", A: "Å", C: "Ç", D: "Ð", E: "É", G: "Ĝ", H: "Ĥ", I: "Î",
N: "Ñ", O: "Ö", S: "Š", T: "Ţ", U: "Û", W: "Ŵ", Y: "Ý", Z: "Ž",
};
// Tokens that must come out byte for byte: {{name}}, %s, %1$d, <b>, </b>
const PROTECTED = /\{\{[^}]*\}\}|%(?:\d+\$)?[sdif@]|<\/?[a-zA-Z][^>]*>/y;
const PAD = "one two three four five six seven eight nine ten".split(" ");
let letters = 0;
function accent(text) {
let out = "";
for (const ch of text) {
if (/\p{L}/u.test(ch)) letters++;
out += ACCENTS[ch] ?? ch;
}
return bidi && out.trim() ? "\u202E" + out + "\u202C" : out;
}
// Returns the index of the brace that closes the one at `open`.
function closing(msg, open) {
for (let i = open, depth = 0; i < msg.length; i++) {
if (msg[i] === "{") depth++;
else if (msg[i] === "}" && --depth === 0) return i;
}
throw new Error("Unbalanced braces in: " + msg);
}
function transform(msg) {
let out = "", text = "", i = 0;
const flush = () => { out += accent(text); text = ""; };
while (i < msg.length) {
PROTECTED.lastIndex = i;
const token = PROTECTED.exec(msg);
if (token) { flush(); out += token[0]; i += token[0].length; continue; }
if (msg[i] !== "{") { text += msg[i++]; continue; }
flush();
const end = closing(msg, i);
const arg = msg.slice(i + 1, end);
const head = arg.match(/^\s*[\w.-]+\s*,\s*(plural|select|selectordinal)\s*,/);
if (!head) {
out += "{" + arg + "}"; // {name} or {due, date, medium}: copy as is
} else {
// Copy the header and the selectors, transform only the branch bodies.
let body = arg.slice(head[0].length), rebuilt = "", j = 0;
while (j < body.length) {
if (body[j] !== "{") { rebuilt += body[j++]; continue; }
const stop = closing(body, j);
rebuilt += "{" + transform(body.slice(j + 1, stop)) + "}";
j = stop + 1;
}
out += "{" + head[0] + rebuilt + "}";
}
i = end + 1;
}
flush();
return out;
}
function pseudo(msg) {
letters = 0;
const body = transform(msg);
// Short strings grow the most in real translation: double them, add 40% to the rest.
const extra = Math.ceil(letters * (letters <= 10 ? 1 : 0.4));
let pad = "";
for (let n = 0; pad.length < extra; n++) pad += " " + PAD[n % PAD.length];
return "[" + body + pad + "]";
}
const walk = (node) =>
typeof node === "string" ? pseudo(node)
: Array.isArray(node) ? node.map(walk)
: node && typeof node === "object"
? Object.fromEntries(Object.entries(node).map(([k, v]) => [k, walk(v)]))
: node;
writeFileSync(output, JSON.stringify(walk(JSON.parse(readFileSync(input, "utf8"))), null, 2) + "\n");
console.log(`Wrote ${output}`);

Given this source file:

jsonjson
{
"cart.items": "{count, plural, one {# item in your cart} other {# items in your cart}}",
"greeting": "Hello, {name}",
"invoice.due": "Invoice {id} is due on {due, date, medium}",
"save": "Save",
"settings.title": "Settings",
"upgrade.cta": "Upgrade to <b>Pro</b>"
}

it wrote this:

jsonjson
{
"cart.items": "[{count, plural, one {# îţém îñ ýöüŕ çáŕţ} other {# îţémš îñ ýöüŕ çáŕţ}} one two three]",
"greeting": "[Ĥéļļö, {name} one two]",
"invoice.due": "[Îñvöîçé {id} îš ðüé öñ {due, date, medium} one two]",
"save": "[Šávé one]",
"settings.title": "[Šéţţîñĝš one two]",
"upgrade.cta": "[Ûpĝŕáðé ţö <b>Pŕö</b> one two]"
}

Each output message was parsed with an ICU parser and compared with its source: same arguments, same plural branches, same tags. With --bidi the script also wraps each run of text in U+202E (right-to-left override) and U+202C (pop directional formatting), defined in Unicode Standard Annex #9, so the letters display in reverse order. That output passed the same comparison.

Its limits: it does not understand ICU apostrophe quoting, such as '{' for a literal brace, and --bidi does not mirror your layout. For that, load the result with dir="rtl" on the html element.

Built-in options on each platform

PlatformWhat is built inHow to turn it on
AndroidTwo pseudolocales. English (XA), en-XA, adds accents, expands the text and brackets each message. AR (XB), ar-XB, sets right-to-left direction and reverses the characterspseudoLocalesEnabled true in the debug build type (isPseudoLocalesEnabled = true in Kotlin), then pick the pseudolocale in the device language settings. Needs developer options enabled
XcodeFive pseudolanguages: Double-Length, Right-to-Left, Accented, Bounded String, and Right-to-Left With Right-to-Left StringsProduct > Scheme > Edit Scheme, select Run, open Options, choose from the App Language menu
WindowsThree pseudo locales: qps-ploc (base), qps-plocm (mirrored), qps-ploca (East Asian)Listed in Microsoft's globalization documentation, which also names the Multilingual App Toolkit Editor for pseudotranslation
Chromium's own buildar-XB and en-XA are packaged into builds that are not official buildsA build argument, enable_pseudolocales. Its comment says it only packages the locales and adds no interface to select them. This helps people who build Chromium, not web developers

On the web there is no built-in pseudo-locale for your own app. Generate one with a script like the one above and register it as a locale that exists only in development builds.

Never ship the pseudo-locale, and give it a tag that cannot collide with a real one. Microsoft's documentation tells how its early pseudo-locale used tk-TM, which later became a real Windows locale and caused many bugs.
Watch out

Part 4: static checks on the translation files

These run on the files alone. The checker below compares every target file with the source and reports six kinds of finding. It parses ICU MessageFormat with @formatjs/icu-messageformat-parser (version 3.5.23), which the i18next checker in the React post does not.

Flat JSON with ICU messages. One dependency: @formatjs/icu-messageformat-parserjs
// check-locales.mjs: node check-locales.mjs [config.json]. Exits 1 on any finding.
import { readFileSync, readdirSync } from "node:fs";
import { join, basename } from "node:path";
import { parse, TYPE } from "@formatjs/icu-messageformat-parser";
const cfg = JSON.parse(readFileSync(process.argv[2] ?? "l10n-check.config.json", "utf8"));
const load = (locale) => JSON.parse(readFileSync(join(cfg.dir, locale + ".json"), "utf8"));
const source = load(cfg.source);
const targets = readdirSync(cfg.dir)
.filter((f) => f.endsWith(".json"))
.map((f) => basename(f, ".json"))
.filter((l) => l !== cfg.source && !/-X[AB]$/.test(l)); // skip pseudo-locales
// Walks an ICU syntax tree. Collects "name:type" for every argument,
// and the selectors of every plural, keyed by argument name.
function inspect(ast, args = new Set(), plurals = []) {
for (const el of ast) {
if (el.type === TYPE.literal || el.type === TYPE.pound) continue;
if (el.type === TYPE.tag) {
args.add(`<${el.value}>`);
inspect(el.children, args, plurals);
continue;
}
args.add(`${el.value}:${TYPE[el.type]}`);
if (el.type === TYPE.plural) {
plurals.push({ name: el.value, type: el.pluralType, keys: Object.keys(el.options) });
}
if (el.options) {
for (const opt of Object.values(el.options)) inspect(opt.value, args, plurals);
}
}
return { args, plurals };
}
const tryParse = (msg) => {
try { return inspect(parse(msg)); } catch (e) { return { error: e.message }; }
};
const graphemes = (s, locale) =>
[...new Intl.Segmenter(locale, { granularity: "grapheme" }).segment(s)].length;
const findings = [];
const report = (locale, key, rule, detail) => findings.push({ locale, key, rule, detail });
for (const locale of targets) {
const target = load(locale);
for (const key of Object.keys(source)) {
if (!(key in target)) report(locale, key, "missing-key", "not in target file");
}
for (const key of Object.keys(target)) {
if (!(key in source)) report(locale, key, "extra-key", "not in source file");
}
for (const [key, value] of Object.entries(target)) {
if (!(key in source)) continue;
const src = tryParse(source[key]);
const tgt = tryParse(value);
if (src.error) { report(cfg.source, key, "icu-syntax", src.error); continue; }
if (tgt.error) { report(locale, key, "icu-syntax", tgt.error); continue; }
// Placeholder parity: same arguments, same types, same tags.
for (const a of src.args) if (!tgt.args.has(a)) report(locale, key, "placeholder", `lost ${a}`);
for (const a of tgt.args) if (!src.args.has(a)) report(locale, key, "placeholder", `added ${a}`);
// Plural coverage: every category the target language uses must have a branch.
for (const p of tgt.plurals) {
const needed = new Intl.PluralRules(locale, { type: p.type }).resolvedOptions().pluralCategories;
const absent = needed.filter((c) => !p.keys.includes(c));
if (absent.length) report(locale, key, "plural", `{${p.name}} lacks: ${absent.join(", ")}`);
}
// Length: counted in user-perceived characters, not UTF-16 code units.
const max = cfg.maxLength?.[key];
const length = graphemes(value, locale);
if (max && length > max) report(locale, key, "length", `${length} > ${max}`);
// Forbidden terms, compared after NFC normalization and locale-aware lowercasing.
for (const term of cfg.forbidden?.[locale] ?? []) {
const fold = (s) => s.normalize("NFC").toLocaleLowerCase(locale);
if (fold(value).includes(fold(term))) report(locale, key, "forbidden-term", `"${term}"`);
}
}
}
for (const f of findings) console.log(`${f.locale}\t${f.rule}\t${f.key}\t${f.detail}`);
console.log(`${findings.length} finding(s) in ${targets.length} target locale(s)`);
process.exit(findings.length ? 1 : 0);

The configuration file names the folder, the source locale, per-key length limits and per-locale forbidden terms:

jsonjson
{
"dir": "locales",
"source": "en",
"maxLength": { "save": 12 },
"forbidden": { "pl": ["za darmo"] }
}

Run against a Polish file with one defect of each kind planted in it, it printed:

Exit code 1. The corrected file gave 0 findings and exit code 0text
pl missing-key settings.title not in target file
pl extra-key old.banner not in source file
pl plural cart.items {count} lacks: many
pl placeholder greeting lost name:argument
pl icu-syntax invoice.due EXPECT_ARGUMENT_CLOSING_BRACE
pl length save 23 > 12
pl forbidden-term upgrade.cta "za darmo"
7 finding(s) in 1 target locale(s)

What each rule is for:

  • Missing and extra keys. A missing key shows the source language or a raw key to the user. An extra key is dead text that still gets translated.
  • Placeholder parity. The translation must keep every argument with the same name and type, and every tag.
  • ICU syntax. One unclosed brace makes the message unparseable.
  • Plural coverage. Intl.PluralRules(locale).resolvedOptions().pluralCategories returns the categories a language uses. Polish returns four. A Polish message with only one, few and other uses other for 5, 12 and 100, which is the wrong form. The parser itself rejects a plural with no other branch.
  • Length. Set limits only where the space is fixed: notification titles, store listing fields, SMS. Count grapheme clusters, since one emoji can be several code units (see Part 8).
  • Forbidden terms. Words your glossary bans in a language: a competitor's trademark, a risky promise, an old product name. Glossary and terminology at scale covers how to build that list.
CLDR's documentation says the plural category names "are only mnemonics". one is the category for any number that behaves like 1, which in Russian includes 21. A test that feeds only 1 and 2 into a plural message proves little. Use the numbers in Part 7.
Watch out

Part 5: layout and truncation

How much room to leave

W3C's guidance is to let text reflow and to avoid small fixed-width containers. Its article on text size gives the cases a layout test has to cover:

  • Short strings grow the most. The word "views" on Flickr became "visualizzazioni" in Italian, three times the length.
  • Long words do not wrap. English "Input processing features" is one German word, "Eingabeverarbeitungsfunktionen".
  • Width is not character count. Japanese "デスクトップ" has one character fewer than "desktop" and takes more horizontal space.
  • Height changes too. The article's Thai example needs about 150% of the vertical space of the Latin text.
  • Shorter is also a defect. A much shorter translation leaves gaps and misaligned columns.

Per-locale projects in Playwright

Playwright's locale option sets navigator.language, the Accept-Language header and the browser's number and date formatting. timezoneId sets its time zone. One project per locale runs the same specs in each. The samples target Playwright 1.65.

Replace the webServer command with the one that starts your appts
// playwright.config.ts
import { defineConfig } from '@playwright/test';
// One project per locale. `locale` sets navigator.language, the Accept-Language
// header and the formatting rules. `timezoneId` sets the browser's time zone.
const locales = [
{ name: 'en', locale: 'en-US', timezoneId: 'America/New_York' },
{ name: 'de', locale: 'de-DE', timezoneId: 'Europe/Berlin' },
{ name: 'ar', locale: 'ar-EG', timezoneId: 'Africa/Cairo' },
];
export default defineConfig({
testDir: './e2e',
use: { baseURL: 'http://localhost:4173', viewport: { width: 390, height: 844 } },
webServer: { command: 'node serve.mjs', url: 'http://localhost:4173' },
projects: locales.map(({ name, ...use }) => ({ name, use })),
});

The options only affect the browser. Playwright's documentation points to the TZ environment variable for the test runner's own time zone. If your app picks its language from a URL prefix or a cookie, set that in the test as well.

Screenshot tests and a clipped-text detector

Five specs, run once per locale projectts
// e2e/locale.spec.ts
import { test, expect } from '@playwright/test';
test('page declares its language and direction', async ({ page, locale }) => {
await page.goto('/');
await expect(page.locator('html')).toHaveAttribute('lang', locale!);
const expectedDir = locale!.startsWith('ar') ? 'rtl' : 'ltr';
await expect(page.locator('html')).toHaveAttribute('dir', expectedDir);
});
test('no raw keys or unfilled placeholders reach the screen', async ({ page }) => {
await page.goto('/');
const text = await page.locator('body').innerText();
expect(text).not.toMatch(/\{\w+\}|\{\{\w+\}\}|%\d*\$?[sd]/); // {name}, {{name}}, %s, %1$s
expect(text).not.toMatch(/\b[a-z]+(\.[a-z_]+)+\b/); // checkout.save_button
});
test('date renders in the zone of the reader', async ({ page, locale, timezoneId }) => {
await page.goto('/');
const expected = new Intl.DateTimeFormat(locale, {
dateStyle: 'long', timeStyle: 'short', timeZone: timezoneId,
}).format(new Date('2026-06-15T16:00:00Z'));
await expect(page.locator('#due')).toHaveText(expected);
});
test('no text is clipped or spills out of its box', async ({ page }) => {
await page.goto('/');
const clipped = await page.evaluate(() => {
const found: string[] = [];
for (const el of document.querySelectorAll<HTMLElement>('body *')) {
const ownText = [...el.childNodes].some(
(n) => n.nodeType === Node.TEXT_NODE && n.textContent!.trim() !== '',
);
if (!ownText) continue;
const style = getComputedStyle(el);
// Case 1: the box hides overflow and the content is larger than the box.
const hidden =
(style.overflowX !== 'visible' && el.scrollWidth > el.clientWidth + 1) ||
(style.overflowY !== 'visible' && el.scrollHeight > el.clientHeight + 1);
// Case 2: overflow is visible and the text is drawn outside the box.
const range = document.createRange();
range.selectNodeContents(el);
const text = range.getBoundingClientRect();
const box = el.getBoundingClientRect();
const spills = text.left < box.left - 1 || text.right > box.right + 1;
if (hidden || spills) found.push(`<${el.tagName.toLowerCase()}> ${el.textContent!.trim()}`);
}
return found;
});
expect(clipped).toEqual([]);
});
test('layout matches the approved screenshot', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveScreenshot('order.png', { maxDiffPixels: 50 });
});

On a demo page with a 110 pixel wide button, the clipping test passed in English and Arabic and failed in German with <button> Änderungen speichern. With a minimum width in place of the fixed width, all 15 tests passed.

Notes on using it:

  • The first screenshot run fails by design. Playwright writes the baseline and later runs compare. Update on purpose with npx playwright test --update-snapshots.
  • Baselines are per project and platform. The file was named order-de-darwin.png. Playwright's documentation warns that rendering varies with the host OS and hardware, so generate baselines in the environment CI uses.
  • Intentional truncation is flagged too. Exclude elements that truncate by design, and make sure their full text is reachable.
  • The raw key pattern is a starting point. It also matches a domain name in the page. Narrow it to your key naming.
  • Run the clipping test on the pseudo-locale first. It covers expansion for every language in one run.
A cream paper-pulp button on a dark stone plinth with a long strip of paper text running past its right edge, the overflowing part made of teal glass
Clipping: the text is longer than the box that holds it

Part 6: right-to-left testing checklist

Run the product in Arabic or Hebrew, or in a right-to-left pseudo-locale, and check each row. The web rows follow W3C's guidance. The icon, control and numeral rows follow Apple's Human Interface Guidelines. Confirm them against your own platform's guidance.

CheckCorrectCommon defect
Base directiondir="rtl" on the html element, set in markup. W3C says not to use CSS for base directionDirection set in a stylesheet, lost when CSS fails to load
Layout mirroringSidebars, columns and table columns run right to left. Text aligns to the startPhysical left and right in CSS, so some blocks stay put
Navigation controlsA back button points right. Next and previous swap sidesArrows that still point left
Progress controlsSliders and progress bars fill from the rightA bar that fills left to right under mirrored labels
Icons that show direction or motionFlippedNot flipped
Logos, checkmarks, clocks, real-world objectsNot flippedFlipped by a blanket transform on every icon
Photos and illustrationsNot flippedMirrored images, including mirrored text inside them
Digits inside a numberSame order as everywhere: "541", phone numbers, card numbersReversed digits
Numeral shapesDecided per locale. Hebrew uses Western Arabic numerals. Arabic may use Western or Eastern Arabic numerals depending on the regionAssuming one shape for all right-to-left locales
Mixed-direction textEach opposite-direction phrase wrapped tightly in an element with dir, or in bdi when the direction is unknownA Latin product name followed by a number or punctuation, with the number on the wrong side
User input and inserted datadir="auto" on inputs and on elements that show user textAn English comment right-aligned with its full stop at the wrong end
PunctuationAt the logical end of the sentence"!olleh" style misplacement

W3C's article on inline bidirectional text lists the cases that fail without markup: an opposite-direction phrase that begins or ends with punctuation, begins with a number, or is followed by a number. Put those strings in your test data.

A pseudo-locale tests mirroring. Bidirectional text needs real mixed strings: a Latin brand name, a number and a question mark inside an Arabic sentence.
In short

Part 7: locale-sensitive logic

Dates, numbers, currency, sorting and search are code, so unit test them. The suite below uses only Intl and Node's built-in test runner.

Nine tests, all passing on Node.js 22.15 with ICU 77.1 and CLDR 47js
// tests/intl.test.mjs: node --test tests/intl.test.mjs
import { test } from "node:test";
import assert from "node:assert/strict";
test("a stored instant renders in the reader's zone, across a date line", () => {
const instant = new Date("2026-06-15T16:00:00Z");
const show = (locale, timeZone) =>
new Intl.DateTimeFormat(locale, { dateStyle: "medium", timeStyle: "short", timeZone }).format(instant);
assert.equal(show("en-GB", "Europe/Paris"), "15 Jun 2026, 18:00");
assert.equal(show("en-GB", "Asia/Tokyo"), "16 Jun 2026, 01:00");
});
test("the same UTC time is a different local time after a daylight saving change", () => {
const hourIn = (iso) =>
new Intl.DateTimeFormat("en-GB", { hour: "2-digit", minute: "2-digit", timeZone: "Europe/Paris" })
.format(new Date(iso));
assert.equal(hourIn("2026-03-28T08:00:00Z"), "09:00"); // UTC+1, the day before the change
assert.equal(hourIn("2026-03-29T08:00:00Z"), "10:00"); // UTC+2: the same UTC time is now an hour later
});
test("numbers and currency: compare parts, not a typed string", () => {
const de = new Intl.NumberFormat("de-DE", { style: "currency", currency: "EUR" });
// The space before the euro sign is U+00A0, so "1.234,50 €" typed with a normal space is not equal.
assert.notEqual(de.format(1234.5), "1.234,50 €");
assert.equal(de.format(1234.5), "1.234,50\u00A0€");
const parts = Object.fromEntries(de.formatToParts(1234.5).map((p) => [p.type, p.value]));
assert.equal(parts.group, ".");
assert.equal(parts.decimal, ",");
assert.equal(parts.currency, "€");
// Japanese yen has no minor unit.
assert.equal(new Intl.NumberFormat("ja-JP", { style: "currency", currency: "JPY" }).format(1234.5), "¥1,235");
});
test("sorting follows the language", () => {
const words = ["Zebra", "apple", "Äpfel", "zoo"];
assert.deepEqual([...words].sort(), ["Zebra", "apple", "zoo", "Äpfel"]);
assert.deepEqual([...words].sort(new Intl.Collator("de").compare), ["Äpfel", "apple", "Zebra", "zoo"]);
assert.deepEqual([...words].sort(new Intl.Collator("sv").compare), ["apple", "Zebra", "zoo", "Äpfel"]);
});
test("search ignores case and accents only when asked to", () => {
const loose = new Intl.Collator("fr", { sensitivity: "base", usage: "search" });
assert.equal(loose.compare("resume", "Résumé"), 0);
assert.notEqual(new Intl.Collator("fr").compare("resume", "Résumé"), 0);
});
test("case mapping is locale-sensitive", () => {
assert.equal("TITLE".toLocaleLowerCase("en"), "title");
assert.equal("TITLE".toLocaleLowerCase("tr"), "tıtle"); // dotless i
});
test("two spellings of the same name match after NFC", () => {
const composed = "Am\u00E9lie"; // é as one code point
const decomposed = "Ame\u0301lie"; // e followed by a combining acute accent
assert.notEqual(composed, decomposed);
assert.equal(composed.normalize("NFC"), decomposed.normalize("NFC"));
});
test("length limits count what the user sees", () => {
const count = (s) => [...new Intl.Segmenter("en", { granularity: "grapheme" }).segment(s)].length;
const family = "\u{1F468}\u200D\u{1F469}\u200D\u{1F467}"; // family emoji: three people joined by U+200D
assert.equal(family.length, 8); // UTF-16 code units
assert.equal([...family].length, 5); // code points
assert.equal(count(family), 1); // what the user sees
// Cutting by code units can split a surrogate pair and leave a lone surrogate.
assert.equal("\u{1F600}".slice(0, 1).isWellFormed(), false);
});
test("plural categories for the numbers that break naive code", () => {
const cat = (locale, n) => new Intl.PluralRules(locale).select(n);
assert.equal(cat("ru", 21), "one");
assert.equal(cat("pl", 22), "few");
assert.equal(cat("pl", 12), "many");
assert.equal(cat("ar", 0), "zero");
assert.equal(cat("fr", 0), "one");
assert.equal(cat("fr", 1_000_000), "many");
});

What the suite teaches about writing such tests:

  • Never compare formatted output with a string you typed. Formatters insert non-breaking spaces. Assert on formatToParts, or write the expected value with an escape.
  • Pin the runtime. Expected strings come from the CLDR data inside it. Node prints its versions in process.versions.icu and process.versions.cldr.
  • Set the time zone in every date test. A test that passes on a laptop and fails in CI is usually reading the machine's zone.
  • Test a daylight saving change and a year boundary. 2026-01-01T02:00:00Z is still 31 December 2025 in Los Angeles.
  • Sort and search with a collator. Default sort() put "Zebra" before "apple". German and Swedish disagree on where "Ä" goes, and both are correct.
  • Test case mapping in Turkish. The lower case of "I" is a dotless "ı" there, which breaks matching written for English.

Part 8: input and data

Users also type, paste and upload in their own language.

Unicode normalization. The same visible text can be stored as different code points. W3C's example is the Hungarian word "világ", where "á" is either one code point (U+00E1) or "a" followed by a combining accent (U+0301). The two are canonically equivalent. W3C's advice is to be consistent, with a preference for NFC, and to avoid the K forms for this purpose. Test: sign up with a decomposed name, then search for it in the composed form.

Emoji and surrogate pairs. In UTF-16, which JavaScript strings use, characters above U+FFFF take two 16-bit code units called a surrogate pair. The Unicode FAQ notes that popular emoji are among them and that an unpaired surrogate is invalid. Test: fill a field to its limit with emoji, then save, reload and export. Look for a character cut in half, storage that rejects or mangles it, and counters that disagree with what the user sees.

Names. W3C's article on personal names lists what forms get wrong: single names, family name first (China, Japan, Korea, Hungary), two or more family names (Spanish and Brazilian usage), patronymics, and long names. It advises asking whether you need separate given and family name fields at all, not requiring a family name, allowing hyphens, apostrophes and spaces, and not forcing capitalization. Each is a test case.

Addresses and phone numbers. MQM lists address format and telephone format as locale convention errors (see Part 10). Test that validation accepts real examples from each market you sell in. Country-by-country rules were not verified for this guide, so take the examples from your own customers.


Part 9: end-to-end smoke tests per locale

A smoke test per locale answers one question: can a user in this locale complete the main flow. Keep it to three or four flows, such as sign up, the core action and payment. The first three specs in Part 5 are the minimum assertions on each screen.

Running every flow in every locale on every commit is slow, and most locales fail in the same way. Choose a small set that fails differently.

RunLocalesWhy
Every commitSource languageBaseline behaviour
Every commitPseudo-locale with expansionHardcoded strings and truncation for all languages at once
Every commitOne right-to-left localeMirroring and bidirectional text
Every commitOne locale with four or more plural categories and a decimal comma, such as PolishPlural and number parsing
Every commitOne CJK localeFonts, character width, line height, no spaces between words
NightlyEvery shipped localeMissing translations and one-off defects
Before releaseEvery shipped locale, plus screenshots for human reviewSign-off

If one slot finds nothing for a month, swap in the locale with the most escaped defects (see Part 14).


Part 10: linguistic testing

In-context review

A reviewer who reads strings in a spreadsheet can confirm grammar and cannot confirm fit. A correct sentence can still be wrong for its screen. Give reviewers the running product in their locale, or the per-locale screenshots your Playwright run already produces. Review what changed since the last release and the screens with the most traffic. Sample the rest.

A bug report template for linguistic issues

One issue per report. The key and the screenshot are what make it fixabletext
Title: [de] Checkout: "Speichern" used for "Save 20%"
Locale: de-DE
Key: checkout.promo.save
Screen/URL: /checkout, promo banner (screenshot attached)
Source text: Save 20%
Current text: 20% speichern
Suggested: 20% sparen
Error type: Accuracy > Mistranslation
Severity: Major
Why: "speichern" means to store a file. The banner is about a discount.
Scope: Check other keys that share this translation memory entry.
Found by: Reviewer name, build 4.12.0

The key is the field people leave out. Without it an engineer has to search for the text, which may exist under several keys.

Error types: the MQM typology

MQM (Multidimensional Quality Metrics) is an error typology published at themqm.org. Using its names keeps reports comparable across reviewers and vendors. MQM Core has seven top-level dimensions.

DimensionCoversExample subtypes
TerminologyTerms that break a termbase or the domainInconsistent with terminology resource, wrong term
AccuracyMeaning that differs from the sourceMistranslation, addition, omission, untranslated, do not translate
Linguistic conventionsWell-formedness in the target languageGrammar, punctuation, spelling, character encoding
StyleAcceptable grammar, wrong styleLanguage register, unidiomatic style, organization style
Locale conventionsFormats for the localeNumber, currency, date, time, measurement, address, telephone, shortcut key
Audience appropriatenessContent unsuitable for the audienceCulture-specific reference, offensive
Design and markupPresentation of the translated productLayout, markup tag, truncation or text expansion, missing text, link

Locale conventions and Design and markup overlap with functional testing. A truncated label is a Design and markup error whether a reviewer or a Playwright test finds it.

Severity levels

MQM's scoring model defines four severity levels and recommends multipliers on an exponential scale.

SeverityMultiplierMeaningAction in a product team
Neutral0A preference or a note. The translation is acceptableLog, no fix required
Minor1Limited impact, does not seriously impede useFix in the next batch
Major5Seriously affects understanding or usability, or sits in a highly visible placeFix before release
Critical25Makes the content unfit for purpose, or risks physical, financial or reputational harmBlock the release

The meanings and multipliers are MQM's. The action column is this guide's suggestion. To score a review, add the multipliers for all errors, then normalize: penalty total times a reference word count, often 1,000, divided by the words evaluated. A sample of 2,000 words with three minor errors and one major error has a penalty total of 8, or 4 per 1,000 words. Track that number per language. MQM notes that in many systems a single critical error fails the sample.


Part 11: accessibility in localized UI

  • Declare the page language. WCAG success criterion 3.1.1, Language of Page, is Level A: the default human language of each page can be programmatically determined. The reason given is that screen readers can then load the correct pronunciation rules.
  • Declare the language of parts. Criterion 3.1.2, Language of Parts, is Level AA. W3C's advice is to put a lang attribute on an element around content in another language. In a localized product that includes strings that fell back to the source language and the names in a language switcher.
  • Use the html element. W3C says to set lang there so it covers the head, and never to use a meta element with http-equiv set to Content-Language.
  • Translate what is not visible. alt text, aria-label, title and placeholder attributes are strings like any other.
  • Listen once per locale. Run a screen reader over the main flow in each language once per release. A test can confirm that lang matches the locale. It cannot confirm that the text sounds right.

Part 12: test data and environments

Keep one fixture file of hard values for unit, end-to-end and manual tests.

KindValues to include
NamesA single name. A family-first name. Two family names. A name with an apostrophe and a hyphen. A name of 60 or more characters. A name in a non-Latin script
TextA composed and a decomposed spelling of the same word. A family emoji. A right-to-left sentence containing a Latin brand name, a number and a question mark
Numbers0, 1, 2, 5, 11, 12, 21, 22, 100, 1,000,000 and 1.5 for plurals. 1234567.891 and a negative amount for formatting
DatesThe day of a daylight saving change. 23:30 on 31 December. A date where day and month are both 12 or less, so a swapped order is visible
Time zonesOne ahead of UTC, one behind, and one with a half-hour offset such as Asia/Kolkata
CurrencyOne with two decimals, one with none such as JPY

For environments:

  • Ship the pseudo-locale in development and staging builds only.
  • Make the locale switchable without changing the device, with a URL parameter or a debug menu.
  • Generate screenshot baselines in CI, not on laptops.
  • Test with the fonts production uses. A CI image without fonts for a script renders empty boxes.
  • Seed data in the target language. English sample data hides sorting and wrapping defects.

Part 13: what to automate and what needs a person

CheckAutomateNeeds a person
Missing and extra keys, placeholders, ICU syntax, plural coverageYes, fullyNo
Length against a stated limitYesTo set the limit
Forbidden and required termsYes, as string matchingTo write the glossary, and to judge inflected forms
Hardcoded strings, concatenationMostly, with a pseudo-locale and the clipping testTo look at screens no test visits
Clipping and overflowYesTo judge intentional truncation
Layout mirroringPartly, with screenshotsTo approve the first baseline and each change
Bidirectional textPartly, with fixed test stringsTo read it. Needs someone who reads the script
Date, number, currency, sorting logicYesNo
Meaning, tone, registerNo. AI review can rank what to read firstYes
Cultural fit, images, colours, examplesNoYes
Screen reader pronunciationOnly that lang is correctYes
Legal and regulated textNoYes, a qualified one

Part 14: regression strategy and metrics

In continuous localization the strings change on every merge, so the tests run on every merge too.

  1. Source change. Run the static checks and regenerate the pseudo-locale in the same pull request. A translation whose source changed is stale: flag it and do not count it as covered.
  2. Translations arrive. Run the static checker on the changed locales and the per-commit smoke set.
  3. Nightly. Run all locales, all smoke flows and all screenshots. Send a reviewer only the screenshots that differ.
  4. Before release. Human review of changed strings and top screens. Fix or waive every major finding. No critical findings.
  5. After an escaped defect. Add a test at the lowest layer that could have caught it. A wrong plural becomes a static rule, not a new end-to-end flow.
A cream paper-pulp funnel on a dark stone plinth with five mesh layers of decreasing coarseness, a few small tiles caught on each layer and one teal glass tile at the bottom
Each layer should catch what it can, so less reaches the next

Treat a screenshot baseline update as a reviewed change, not a routine one.

MetricDefinitionUse
Defect escape rate by localeLocalization defects found after release divided by all localization defects found, per localeShows which locale your tests cover worst. Move it into the per-commit set
Defects by typeEscaped defects grouped as i18n, functional or linguistic, then by MQM dimensionShows which layer of the pyramid is too thin
Translation coverageTranslated keys divided by total keys, per localeBelow 100% means users see the source language
Reviewed coverageHuman-reviewed keys divided by total keys, per localeHow much of what ships a person has read
Test coverage by localeSmoke flows run in a locale divided by flows definedExposes locales that ship untested
Static check failures per runFindings from the checker, by ruleA rising count points at source text, glossary or engine problems
Normed penalty per 1,000 wordsThe MQM figure from Part 10, per languageLinguistic quality trend
Time to fixFrom report to corrected string in production, per localeWhether the reviewer loop works

Doing this with Transglot

Transglot is a continuous localization platform. This section states which checks from this guide it runs and which it leaves to you, going by its quality checks documentation and CLI reference.

What it does, on every plan, on every string before it is written:

  • Placeholder parity. It flags a missing, added or changed placeholder, such as {name}, %s or an HTML tag.
  • Plural coverage. It flags a plural key that lacks a form the target language needs. How placeholders and plurals are read depends on the project's Message syntax setting. See plural forms.
  • Length. It flags a translation longer than the key's maximum length, and with screenshots a translation likely to overflow its space.
  • Glossary and forbidden terms. It flags a departure from a glossary term, a forbidden word, or a translated term marked Do not translate.
  • Failure handling. A draft that still breaks a placeholder, a plural form or a forbidden glossary term after one retry is not written, and the run reports it. A length overrun is written as a draft, not refused.
  • ICU validity. The CLI reference states that invalid ICU translations are omitted from a pull and named in the output.

On Team and above, an AI review pass gives each translation a 0 to 100 score and findings grouped by MQM categories, each blocking or warning. It counts toward usage. It ranks what a reviewer should read first and is not linguistic sign-off. Reviewers can correct wording on the running page with the in-context editor.

What it does not do:

  • Pseudo-localization. The documentation describes no pseudo-locale feature. Use the script in Part 3 or your platform's built-in option.
  • A missing-key gate in your repository. Untranslated keys are absent from pulled files, so the key comparison in Part 4 is still yours to run.
  • Layout, screenshot and clipping tests. Its length check works from a limit or a captured screenshot. It does not render your build.
  • Right-to-left rendering, Intl logic, input handling and accessibility. These test your code, not the translations.
  • Human linguistic review. It does not supply reviewers.

Other limits: the Free plan is the browser console only, the CLI, GitHub Action and API start on Starter, and it cannot be self-hosted. See pricing.


Common mistakes

  • Testing only the source language and one similar target. Pick locales that fail differently: a long one, a right-to-left one, one with four plural forms, one CJK.
  • Starting pseudo-localization after translation. Its value is finding code defects before you pay for words.
  • Accenting placeholders. A pseudo-localizer that does not protect ICU syntax produces failures that look like real bugs.
  • Testing plurals with 1 and 2. The failures are at 0, 5, 11, 21 and 22.
  • Comparing formatted numbers with typed strings. The invisible non-breaking space fails the test.
  • Screenshot baselines made on a laptop. They do not match CI.
  • Sending layout bugs to translators. The translation gets shorter and worse. The container stays broken.
  • Mirroring every icon. Clocks, checkmarks and logos do not flip.
  • Counting characters with .length. One emoji can count as eight.

Checklist

texttext
Static, every commit
[ ] Every target file has exactly the source's keys
[ ] Placeholders and tags match the source in name and type
[ ] Every message parses as valid ICU
[ ] Every plural has all categories of its language
[ ] Length limits set and checked for fixed-space strings
[ ] Forbidden terms checked per locale
Pseudo-localization
[ ] Pseudo-locale generated in the build, placeholders protected
[ ] Expansion pseudo-locale and right-to-left pseudo-locale both viewable
[ ] No unaccented text, no split brackets, no missing closing bracket
[ ] Pseudo-locale not selectable in production
Unit
[ ] Dates tested with an explicit time zone, a DST day and a year boundary
[ ] Numbers and currency asserted by parts, not typed strings
[ ] Sorting and search use a collator
[ ] Plural selection tested at 0, 1, 2, 5, 11, 12, 21, 22, 1,000,000
[ ] Strings normalized to NFC before comparison
[ ] Length counted in grapheme clusters
Browser
[ ] One project per locale with locale and time zone set
[ ] html lang and dir asserted
[ ] No raw keys or unfilled placeholders on screen
[ ] Clipped-text test passes in the pseudo-locale
[ ] Screenshot baselines generated in CI and reviewed on change
[ ] Per-commit locale set: source, pseudo, one RTL, one multi-plural, one CJK
[ ] All locales nightly
Right to left
[ ] dir set in markup, logical CSS properties
[ ] Direction icons flipped, logos and clocks not
[ ] Mixed-direction strings tested with a brand name, a number and punctuation
People
[ ] A named reviewer per language
[ ] In-context review of changed strings and top screens per release
[ ] Bug template with key, screenshot, MQM type and severity
[ ] Screen reader pass per locale per release
Tracking
[ ] Defect escape rate by locale
[ ] Coverage and reviewed coverage by locale
[ ] Normed penalty per 1,000 words by language

Frequently asked questions

What is localization testing?

Localization testing verifies that a product works and reads correctly in a specific language and region. It covers function, such as layout, formats, input and sorting, and language, such as meaning, grammar and terminology. It is run on the built product, per locale.

What is the difference between internationalization testing and localization testing?

Internationalization testing checks that the code can support any locale: no hardcoded strings, no concatenated sentences, flexible layouts, platform formatters. It needs no real translation and is usually done with a pseudo-locale. Localization testing checks one real locale in the built product.

What is pseudo-localization?

Pseudo-localization replaces source strings with altered but readable copies: accented letters, extra length, brackets around each message, and optionally reversed direction. It exposes hardcoded text, truncation, concatenation and mirroring defects before any translation exists. Android and Xcode have it built in.

What is linguistic testing?

Linguistic testing is a native speaker reviewing translated text in context for meaning, grammar, terminology, tone and cultural fit. Findings are classified with an error typology such as MQM and given a severity.

Can localization testing be automated?

Most of the structural and functional part can: key parity, placeholders, ICU syntax, plural forms, length, formatting logic, clipping and screenshots per locale. Meaning, tone, cultural fit and screen reader pronunciation need a person.

How do I test a right-to-left layout if I do not read Arabic or Hebrew?

Use a right-to-left pseudo-locale, such as Android's ar-XB or Xcode's Right-to-Left Pseudolanguage. That covers mirroring, icons and alignment. Bidirectional text, such as a Latin name inside an Arabic sentence, still needs a reader of the script.

Which locales should I test on every commit?

A small set that fails in different ways: the source language, an expansion pseudo-locale, one right-to-left locale, one locale with four or more plural categories, and one CJK locale. Run every shipped locale nightly and before release.

How this guide was checked

  • Scripts that were run. All on Node.js 22.15.1 (ICU 77.1, CLDR 47), macOS. pseudo.mjs was run on the sample file shown, with and without --bidi, and each output was compared with its source using isStructurallySame from @formatjs/icu-messageformat-parser 3.5.23. check-locales.mjs was run on a broken Polish file (output shown, exit code 1) and a corrected one (0 findings, exit code 0). tests/intl.test.mjs passed 9 of 9. The Playwright config and spec were run with @playwright/test 1.65.1 against a small demo page: 15 tests, with the German clipping failure shown, then 15 passing after the CSS fix.
  • How the Playwright run differed. It used a Chromium headless shell already cached on the machine, set through launchOptions.executablePath, not the build Playwright 1.65.1 downloads. Firefox and WebKit were not run. Screenshots were compared on macOS only.
  • Pseudo-localization. The transformations, the 40% heuristic, the Windows pseudo locales and the tk-TM story follow Microsoft's globalization documentation. Android's pseudolocales follow the Android developer documentation. The Xcode pseudolanguage names come from Xcode Help and the scheme path from Apple's developer documentation. Neither was run on a device or in Xcode. The Chromium note comes from build/config/locales.gni.
  • Static checks. pluralCategories follows MDN. The parser's error names and node types are not listed on its documentation page and are as observed in version 3.5.23.
  • Layout. Expansion figures are from W3C's "Text size in translation", which attributes its averages to IBM. Playwright options follow its emulation, snapshot and test options pages.
  • Right to left. Web rows follow W3C's two articles. Icon, control and numeral rows follow Apple's Human Interface Guidelines. Material Design's bidirectionality page could not be read in this session and is not cited.
  • Input and data. Normalization follows W3C and MDN. Surrogate pairs follow the Unicode FAQ. Names follow W3C. Address rules per country were not verified and are not described.
  • Linguistic testing. The MQM dimensions, subtypes, severities, multipliers and normalization are from themqm.org. Its quality score formulas are images and are not reproduced. The action column and the bug report template are this guide's own.
  • Accessibility. WCAG 3.1.1 and 3.1.2 follow W3C's Understanding document. No screen reader was run.
  • Not measured. The cost column of the pyramid, the per-commit locale set and the regression steps are working practice, not a study. The Polish and German sample strings were not reviewed by a professional translator.
  • Other tools. Transglot's behaviour is taken from its documentation, not from a test run for this guide. No other localization platform was tested or benchmarked.

Sources

colophon

Who wrote this, and what to read next

wrote this

transglot team

The byline on this post has no profile yet. Author profiles are managed alongside the posts themselves.

Engineering
keep reading

Automated localization QA with Transglot

Catch broken placeholders, incomplete plurals and terminology conflicts. Learn what automated QA proves, where human review matters and how to validate a release.

March 31, 2026
6 min read
keep reading

React localization: check keys, variables and plurals

Build a small React localization workflow with i18next. Catch missing keys, renamed variables and plural errors before deployment with a Node.js CI check.

November 9, 2026
10 min read
keep reading

Software Localization: The Complete Guide (2026)

What software localization is, how i18n differs from l10n, the engineering work that comes first, the process, quality checks, cost and a launch plan.

November 23, 2026
27 min read
works with what you already run

41 connectors, already built.

the pipeline this post describes

Try it on your own strings. Free, no card.

Free plan: 100,000 words to start (25,000 at sign-up, 75,000 after a phone check), then 10,000 a month, 15 locales including your source, 3 seats.