# Fix the translation agent skipping RTL pseudo-locale verification

## TL;DR

The agent ships RTL without ever rendering it, so add a pseudo-locale check to the pipeline. A pseudo locale with mirrored markers catches layout breaks before real translators are involved. Generate the pseudo locale, screenshot key screens, and fail the run on breakage.

## The error

```text
Translation agent: QA checks failed, RTL layout broken in production
no pseudo-locale verification ever ran
```

## Fix it

### Step 1: Generate a pseudo locale from the source strings

```bash
node -e "console.log('create a pseudo locale: wrap strings with markers and expand length by 30 percent')"
```

Expected: You have a test locale that stresses layout.

### Step 2: Add it to the agent pipeline before shipping

```bash
grep -n "verify\|qa" scripts/translate-agent.js | head -5
```

Expected: You find where to hook the check.

### Step 3: Render key screens in the pseudo locale

```bash
node -e "console.log('screenshot the top screens with the pseudo locale active')"
```

Expected: You see expansion and bidi issues as visual breaks.

### Step 4: Gate the release on the check

```bash
node -e "console.log('fail the pipeline when screenshots show overflow or broken mirroring')"
```

Expected: Broken RTL never ships silently again.

## When to use this

- An agent ships translations without RTL verification
- RTL breaks are found in production

## When NOT to use this

- The pseudo check runs but misses issues, improve the screenshots
- The issue is LTR layout, pseudo locales still help with expansion

## Tool and version compatibility

- Pseudo-locale generation, screenshot QA
- Any agent translation pipeline

## Variant phrasings

### pseudo locale exists but the agent skips it

Make it a required gate, not an optional step. Optional checks get skipped.

### no screenshot infra yet

Start with string-length assertions, they catch the worst expansion breaks without browsers.

## Why it happens

Real RTL translations arrive late and are expensive to fix against. Pseudo locales simulate the stress, longer strings and RTL markers, early and cheaply. Skipping that step means the first RTL render happens in production.

## Edge cases

- Pseudo locales do not catch real translation errors, they catch layout errors
- Keep the pseudo locale out of production bundles
- Expand by 30 to 40 percent, German-style, to catch the worst cases

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_qU9E72oUzz8Y5fYdW7r_9g
