Localization & RTL
How storefront strings layer, and what themes must get right for RTL.
Cartisto is multilingual first. Themes must render correctly in both LTR and RTL (Arabic is a first-class target).
How strings layer
Storefront strings come from two layers, deep-merged at request time:
- Base — a shared platform locale used by every theme.
- Theme override —
locales/<lang>.jsonin your theme, layered on top.
Override only the keys you want to change; you don’t redefine a whole branch.
// locales/en.json
{ "product": { "addToCart": "Add to bag" } }
Read strings with the t filter (pluralization +
interpolation) or as an object ({{ t.product.addToCart }}).
The i18n completeness gate
The Quality Gate fails a publish if your
locales disagree on keys — every language must define the same set. This catches
a string translated in en but forgotten in ar before it ships.
RTL rules
- Use logical CSS (
margin-inline-start,padding-inline-end,inset-inline) rather than left/right where direction matters. - Read
isRTLin templates when you must branch, and setdirfrom the language (the platform layout handles the documentdir). - The RTL gate loads your pages under
dir=rtlat mobile/tablet/desktop and fails on any horizontal overflow — so a component that breaks the layout in Arabic can’t ship.
Test both directions early
Switch the store to Arabic and click through home, listing, PDP, and the cart
drawer. Most RTL bugs are one hard-coded left/right away, and they’re much
cheaper to fix before you’ve styled around them.