Lesson 28 of 30
This platform's own i18n lesson covers the technical machinery — pluralization, Intl, translation files. This one covers what happens to the layout itself once a translated string doesn't fit, or the whole page needs to read right-to-left.
12 min read
Every option explains itself — why the right one is right, and why each wrong one is wrong. Miss one and it comes back later on a spaced-repetition schedule.
Question 1 of 3
In an RTL (right-to-left) layout, which of these icons should mirror, and which shouldn't: a 'forward' arrow, and a settings gear?
Hints without spoilers, and a plain explanation of why a wrong answer was wrong — answered only from this lesson. Free account, no card.
Sign up freeWhat interviewers actually ask about this, and what a strong answer has to cover.
A strong answer covers
Likely follow-ups
Supporting Arabic, Hebrew, and other RTL (right-to-left) languages is not "flip the text direction and ship it." Two layout consequences get missed even by teams that handle the translation strings correctly:
The fix that makes both of these largely automatic rather than something a developer hand-maintains per component is CSS logical properties: margin-inline-start instead of margin-left, padding-inline-end instead of padding-right, inset-inline-start instead of left. Logical properties are defined relative to text direction, not a fixed physical side — set dir="rtl" on the document and every logical-property value flips automatically, with zero component-level RTL-specific code. A codebase built on physical properties (margin-left everywhere) needs a parallel RTL override for nearly every one of those declarations, hand-maintained and easy to let drift out of sync as the product grows.
A product card with a "favorite" heart icon in the top corner, a directional "view details →" link, and a non-directional trash icon in an admin overflow menu: in RTL, the card's whole layout mirrors (the heart icon moves to the opposite corner, since that corner is now the start of reading direction), the arrow flips to point left (still "forward" relative to RTL reading direction), and the trash icon stays exactly as drawn, because deleting something has no directional meaning to preserve. A team that mirrors everything indiscriminately ships a flipped trash icon that reads as a rendering bug, not a localization feature — and a team that mirrors nothing ships an arrow that visually points the wrong way for the reading direction it's meant to guide.
left/right, margin-left) requires a hand-maintained parallel set of RTL overrides. Logical properties (inline-start/inline-end) get RTL correctness for free from dir="rtl", with no per-component override needed — this is a real, current CSS feature, not a future aspiration.left, text-align: left, custom carousel/swipe logic assuming left-to-right motion, and icon fonts that don't ship mirrored variants are the recurring offenders."How would you make this component RTL-safe?" is testing whether a candidate reaches for logical properties as the systemic fix (versus a per-component dir === "rtl" ? ... : ... conditional scattered everywhere) and can correctly reason about which specific icons need mirroring — both are concrete, checkable signals of someone who's actually shipped a product outside a single-language, LTR-only market.