---
title: "Test with a pseudo-locale · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/languages-and-regions/pseudo-localisation
updated: 2026-10-20
licence: "All rights reserved"
---

# Test with a pseudo-locale

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Languages and regions](https://agentwranglers.se/playbook/website/languages-and-regions)
- Rule: When a site will be translated, build a pseudo-locale that makes every text longer and accented. Run the page tests in it before any translation exists.
- How: Generate the pseudo-locale from the default messages. Swap letters for accented ones, add about 40% extra length, and wrap each text in brackets. Run the browser tests at phone width in this locale. Text without brackets is not in the message file, and cut or overlapping text shows where the layout cannot grow.
- Check: The browser tests pass in the pseudo-locale. A test finds no visible text node without the brackets, and no element that scrolls sideways.

Example:

```js
const ACCENTED = { a: 'á', e: 'é', i: 'í', o: 'ö', u: 'ü', A: 'Å', E: 'É', O: 'Ö' };
const EXTRA_LENGTH = 0.4;
const pseudo = text => {
  const accented = text.replace(/\{[^}]*\}|./g, c => (c.length > 1 ? c : ACCENTED[c] ?? c));
  return `[${accented}${'~'.repeat(Math.ceil(text.length * EXTRA_LENGTH))}]`;
};
pseudo('Book a call {name}'); // "[Böök á cáll {name}~~~~~~~~]"
```

```python
import math
import re
ACCENTED = str.maketrans("aeiouAEO", "áéíöüÅÉÖ")
EXTRA_LENGTH = 0.4
def pseudo(text: str) -> str:
    parts = re.split(r"(\{[^}]*\})", text)
    accented = "".join(p if p.startswith("{") else p.translate(ACCENTED) for p in parts)
    return f"[{accented}{'~' * math.ceil(len(text) * EXTRA_LENGTH)}]"
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers website playbook: https://agentwranglers.se/playbook/website/languages-and-regions/pseudo-localisation`.

- Previous: [Translate whole sentences](https://agentwranglers.se/playbook/website/languages-and-regions/whole-sentence-messages)
- Next: [Sort and compare text by locale](https://agentwranglers.se/playbook/website/languages-and-regions/locale-collation)
- [Languages and regions](https://agentwranglers.se/playbook/website/languages-and-regions)
