UI Text Expansion Previewer
Check where buttons, navbars, and cards overflow when English UI copy expands in German, French, Russian, Arabic, or Japanese.
100% client-side: Your HTML and CSS stay in your browser and render inside a strict zero-script sandbox.
Short labels grow faster than paragraphs
English interface copy is a weak guide to layout. A button that reads Save, a navbar link, or a price chip often overflows first, because a short label grows much faster than a paragraph. German compounds stress narrow controls, and Arabic flips inline direction. This previewer applies a length-aware stand-in and renders the snippet at 375 pixel, 768 pixel, and full desktop widths.
The stand-in is deterministic, so the same snippet and preset always produce the same characters. English leaves every string untouched. German, French, and Russian lengthen copy. Japanese reduces the character count while glyphs stay wide. Arabic sets direction to rtl.
Planning ranges by language
IBM and W3C notes separate short labels from body copy. The chart is the planning range used here. Spanish and Italian are included for estimates. Live presets cover German, French, Russian, Arabic, and Japanese. Short labels are 1 to 10 characters. Body copy is longer than 40 characters.
| Language | Short labels (1–10 chars) | Body copy (over 40 chars) |
|---|---|---|
| English | 100% | 100% |
| German | +50% to +80% | +15% to +30% |
| French | +40% to +55% | +15% to +20% |
| Spanish | +30% to +50% | +15% to +25% |
| Italian | +30% to +45% | +15% to +20% |
| Russian | +40% to +55% | +15% to +20% |
| Arabic | +40% to +50% | +15% to +20% |
| Japanese | 10% to 30% shorter | 10% to 25% shorter |
Five CSS habits that survive translation
Use min-width only to keep a hit target easy to tap, and let the label wrap instead of clipping it. Set overflow-wrap to anywhere so a German compound can break inside a narrow button. Set flex-wrap to wrap on a navbar so a longer label drops to the next line. Prefer gap between items, because a physical margin does not follow direction. Use margin-inline-start rather than a left margin so the indent stays correct when direction is rtl.
FAQ
Why do short button labels expand by up to 80%?
Save has almost no spare wording, so German and French can add 50 to 80 percent. A paragraph can be rephrased and usually grows by only 15 to 30 percent.
What does pseudo-localization test?
It swaps each translatable string for a longer or shorter stand-in with accents, Cyrillic, Arabic, or Japanese characters, and shows clipping, wrapping, and right-to-left alignment before a translation is ordered.
How do translate="no" and code behave in the previewer?
With the respect option on, translate no, class notranslate, code, pre, kbd, samp, and var stay exact, while a translate yes descendant expands again.
Why does the preview run inside an iframe with sandbox=""?
The iframe uses an empty sandbox attribute, so the snippet cannot run scripts, submit forms, or read the parent page. Script tags, event handlers, refresh meta tags, iframes, objects, and embeds are removed first.
Does the HTML leave the browser?
No. HTML and CSS stay in the browser, copy and download stay local, and input above 500 KB is refused. Nothing is uploaded.
Relax a pixel-locked button with the Figma CSS un-breaker. Convert physical margins with the CSS logical converter so Arabic alignment follows direction. Lock names with the translate="no" protector before a translation pass. The guide on translating HTML without breaking layout covers the remaining release checks. More utilities sit in the tools hub, and static HTML can be translated with HTML Translate.