Building bilingual Arabic / English storefronts: 7 RTL lessons
Right-to-left is more than flipping text. Fonts, logical CSS, icons, search and hreflang — the lessons from building stores for Arabic and English customers.
Ahmed Showky
Full Stack Web Developer
1 min read
Most of the stores I build serve customers in both Arabic and English. Getting right-to-left (RTL) right is much more than flipping text direction. Here are the lessons I wish I'd known on day one.
1. Set dir and lang on the root
Put lang="ar" dir="rtl" on <html> for Arabic pages. Browsers, screen readers and search engines all rely on it.
2. Use logical CSS properties
Replace margin-left with margin-inline-start, and left with inset-inline-start. Your layout then mirrors automatically:
.card {
padding-inline: 1.5rem;
border-inline-start: 3px solid var(--accent);
}
3. Pick Arabic fonts on purpose
Latin fonts don't include Arabic letters, so the browser falls back to whatever it finds. Choose an Arabic family that matches your brand's weight and tone, and list it right after your Latin font.
4. Never add letter-spacing to Arabic
Arabic letters connect. Tracking breaks those joins and makes words hard to read. Reset letter-spacing for RTL.
5. Flip directional icons, not every icon
Arrows and "next" chevrons should mirror. Logos, play buttons and checkmarks should not.
6. Plan search and filters for both languages
Product titles, collection names and filter values need translations too. Otherwise, half your customers can't find anything.
7. Tell Google about both versions
Give each language its own URL, link them with hreflang, and add a matching canonical tag to each page. That way, each audience lands on the right version.
Bilingual UX is a competitive edge in our region. Done well, customers simply feel at home.
Have a project in mind?
I build fast, bilingual stores and web apps. Let’s talk about yours.