---
title: "Test with a pseudo-locale · Agent Wranglers"
url: https://agentwranglers.se/playbook/localization/layout-and-scripts/pseudo-localisation
id: LOC-14
level: Recommended
updated: 2026-10-22
tokens: 908
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Test with a pseudo-locale

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Layout and scripts](https://agentwranglers.se/playbook/localization/layout-and-scripts.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-22.

- ID: LOC-14
- Level: Recommended
- Chapter: [Layout and scripts](https://agentwranglers.se/playbook/localization/layout-and-scripts.md)
- 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.
- 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.
- 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. Catch the breaks with [Compare screenshots of every component state](https://agentwranglers.se/playbook/app-ui/tests-and-budgets/visual-regression.md).

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### JavaScript 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 example

```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)}]"
```

## Sources

- [Microsoft Learn: Pseudolocalization](https://learn.microsoft.com/en-us/globalization/methodology/pseudolocalization)

## Related rules

- LOC-21 [Give translators context and a review step](https://agentwranglers.se/playbook/localization/messages-and-translation/translator-context.md) in Localization
- LOC-30 [Let every layout grow with the longest translation](https://agentwranglers.se/playbook/localization/layout-and-scripts/text-expansion.md) in Localization
- APP-55 [Compare screenshots of every component state](https://agentwranglers.se/playbook/app-ui/tests-and-budgets/visual-regression.md) in Web app interface

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/localization/layout-and-scripts/pseudo-localisation">Agent Wranglers localization playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Let every layout grow with the longest translation](https://agentwranglers.se/playbook/localization/layout-and-scripts/text-expansion.md)
- Next: [Support right-to-left text](https://agentwranglers.se/playbook/localization/layout-and-scripts/rtl-support.md)
- [Layout and scripts](https://agentwranglers.se/playbook/localization/layout-and-scripts.md)
