Chapter 02·Common UI Defects·~6 min·
Text Expansion and Layout Budgeting
Translated text changes length in characters, UTF-8 bytes, and rendered pixels. User interface containers must budget horizontal width and vertical line height across scripts.
Overview
Translated strings rarely match the bounding box of English source text. European languages often expand horizontally, while Brahmic and Southeast Asian scripts require additional vertical line height. Fixed pixel dimensions cause clipping and overflow.
Core rule
Budget +100% to +200% extra width for English strings under 10 characters and +30% for strings over 70 characters, and use flexible containers that wrap and grow.
Specification note: Horizontal width and vertical height vary independently. Thai often renders narrower than English while requiring significantly more line height for stacked diacritics.
Failure mode
Interface mockups often size buttons and labels to fit English copy. The English string “Add to cart” has 11 characters. The German translation “In den Warenkorb” has 16 characters (+45%), the Portuguese “Adicionar ao carrinho” has 21 characters (+91%), and the Simplified Chinese “加入购物车” has 5 characters (-55%).
Short strings expand by the largest percentage because translated articles, prepositions, and grammatical inflections add a high proportion of characters. Fixed-width containers truncate labels or overflow into adjacent icons and padding.
Translated strings expand or contract significantly compared to English. Containers with fixed widths truncate copy, clip accents, and break layouts.
Business stakes & user risk
Truncated action buttons (such as checkout and signup buttons) reduce conversion rates. Overlapping text destroys visual hierarchy and makes applications look untrustworthy to international customers.
Rule of thumb
Reserve 100% extra horizontal width for short strings under 10 characters, and 30% extra for longer paragraphs.
The Novice Trap vs. Production Standard
Contrast the intuitive assumption with the architecture required for global releases.
“A button designed to fit English 'Save' or 'Add to Cart' will fit in any language.”
Naive approach: Fixed CSS width
<button style={{ width: "110px", height: "36px" }}>Add to Cart</button>Defect:In German, 'In den Warenkorb' (16 characters) overflows the 110px boundary or truncates to 'In den Wa...'.
Short labels expand by the highest percentage. German, French, and Portuguese frequently double the width of concise English phrases.
Production standard: Flexible container sizing
<button className="min-w-[120px] max-w-full px-4 py-2 text-wrap">In den Warenkorb</button>Benefit:Container expands with content, allows wrapping if necessary, and preserves touch targets across languages.
Cross-Functional Review Questions
Questions for product managers, designers, engineers, and testers to ask during sprint reviews.
“Do our design system components use auto-layout and min-width constraints rather than fixed pixel widths?”
“Does the layout budget extra vertical line-height for scripts with stacked diacritics?”
“Have we audited core conversion funnels in German and Portuguese before launch?”
“Do automated visual regression tests inspect components in expanded pseudolocalization?”
Mechanism
Horizontal and vertical text expansion
Translated text changes length because languages encode grammar differently. German forms long compound nouns, Russian and Finnish add case inflections, and Romance languages insert articles and prepositions. Short UI labels expand by the largest percentage because grammatical particles make up a large share of a short string. The W3C and IBM expansion guidelines specify +100% to +200% additional width for source strings up to 10 characters, tapering to +30% for strings over 70 characters.
Expansion also operates in reverse and along the vertical axis. Chinese and Japanese strings frequently use 30% to 50% fewer characters than English, so components must look balanced when text contracts. Scripts such as Thai, Devanagari, and Arabic stack diacritics, vowel marks, and tone marks above and below the baseline. These scripts require 20% to 40% more line-height than Latin text to prevent vertical clipping.
Interactive demo
Guided exercises
- 1Keep the “CTA button” scenario and drag the container width down until German (“In den Warenkorb”) breaks. English still fits at the width where German wraps or truncates. The percentage badges report each locale's length change relative to the English source.
- 2Find Chinese (加入购物车) and Japanese in the grid. Chinese and Japanese contract relative to English (−55% and −45% on this button), so fixed wide buttons leave excess whitespace.
- 3Switch the scenario to “Notification card”. Longer full sentences expand by a smaller percentage than short labels. The maximum expansion drops from +91% on the button to +26% on the card.
- 4Pick the narrowest width where every locale still renders acceptably. That pixel measurement defines the minimum safe container width for the component across all target locales.
Add to cart
In den Warenkorb
Ajouter au panier
Añadir al carrito
Adicionar ao carrinho
Aggiungi al carrello
Добавить в корзину
Dodaj do koszyka
Lisää ostoskoriin
加入购物车
カートに追加
أضف إلى السلة
One string, three different sizes
UTF-8 takes 1 byte for ASCII, 2 for Cyrillic and Arabic letters, and 3 for Chinese and Japanese characters. Pixel width is set by the font and matches neither count.
| Locale | Title | Code points | UTF-8 bytes | px | vs. en-US |
|---|---|---|---|---|---|
| en-US | Add to cart | 11 | 11 | — | 0% |
| de-DE | In den Warenkorb | 16 | 16 | — | +45% |
| fr-FR | Ajouter au panier | 17 | 17 | — | +55% |
| es-ES | Añadir al carrito | 17 | 18 | — | +55% |
| pt-BR | Adicionar ao carrinho | 21 | 21 | — | +91% |
| it-IT | Aggiungi al carrello | 20 | 20 | — | +82% |
| ru-RU | Добавить в корзину | 18 | 34 | — | +64% |
| pl-PL | Dodaj do koszyka | 16 | 16 | — | +45% |
| fi-FI | Lisää ostoskoriin | 17 | 19 | — | +55% |
| zh-CN | 加入购物车 | 5 | 15 | — | -55% |
| ja-JP | カートに追加 | 6 | 18 | — | -45% |
| ar-SA | أضف إلى السلة | 13 | 24 | — | +18% |
“vs. en-US” compares rendered pixel width, the measure that decides overflow.
Writing to a limit
The CAT tool's counter, the limit in the spec, and the width the UI enforces measure different things.
German: 16 characters: exactly a 16-character limit
Graphemes
16
user-perceived characters
Code points
16
[...str].length
UTF-16 units
16
str.length
Pixels
0
box is 120px
In the box
Inside both limits. The Japanese preset has six characters; compare its pixel count.
The three counts diverge only on non-ASCII text. An emoji with a skin tone is one grapheme, two code points, and four UTF-16 units. A budget expressed in .length charges it four times.
The 30% figure is for long text
IBM's table applies a flat +30% only past 70 characters. In the CTA button scenario, the badges run from −55% (Chinese) to +91% (Portuguese).
- Budget widths in measured pixels.
- Let subtitles wrap to two lines.
- Position CTAs with
inset-inline-end: an element placed withrightstays on the right in Arabic and Hebrew.
Implementation rules
- Budget container width by source string length. The IBM and W3C expansion table requires +100% to +200% extra width for strings up to 10 characters, tapering to +30% for strings over 70 characters. Verify layouts early with pseudolocalization.
- Avoid fixed width and height constraints. Use
min-widthwith flexiblemax-width. Provide sufficientline-heightfor scripts such as Thai, Arabic, and Devanagari, where stacked vowel marks and diacritics clip inside tight vertical boxes. - Provide accessible disclosure when truncation is required. In compact badges or table headers, expose the full string via a tooltip or expandable view. Do not replace text labels with unvalidated icons, because visual metaphors vary by region.
- Measure rendered pixel width in CI. Character counts do not predict pixel width across proportional fonts and CJK ideographs. Test components against the longest translated strings before release.
Operational context
Roles
Workflow stages
- ·Design review for UI components
- ·Component library layout audits
- ·Pre-release QA on translated builds
See it in a market: Germany · reserve +50% width for compounds →
Production incident
The IBM localization expansion table, republished by the W3C, assigns the largest percentage growth to the shortest English strings. Navigation tabs, buttons, and status badges are the components most likely to use fixed widths and the components that expand the most in translation.