<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Digital Graphiks</title>
    <description>The latest articles on DEV Community by Digital Graphiks (@digitalgraphik).</description>
    <link>https://dev.to/digitalgraphik</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4261083%2F2cd15cef-55ef-4bc8-bef7-ec900be53234.png</url>
      <title>DEV Community: Digital Graphiks</title>
      <link>https://dev.to/digitalgraphik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/digitalgraphik"/>
    <language>en</language>
    <item>
      <title>Building Bilingual (Arabic + English) Shopify Themes: Practical RTL Lessons</title>
      <dc:creator>Digital Graphiks</dc:creator>
      <pubDate>Mon, 23 Nov 2026 17:15:30 +0000</pubDate>
      <link>https://dev.to/digitalgraphik/building-bilingual-arabic-english-shopify-themes-practical-rtl-lessons-10ec</link>
      <guid>https://dev.to/digitalgraphik/building-bilingual-arabic-english-shopify-themes-practical-rtl-lessons-10ec</guid>
      <description>&lt;p&gt;If you build storefronts for clients in the Gulf, sooner or later someone asks for an Arabic version of their Shopify store. Shopify Markets and the translation tools handle the words, but the theme has to handle direction. Right-to-left (RTL) support is where many otherwise solid themes fall apart: arrows point the wrong way, carousels slide backwards, prices wrap strangely and icons sit on the wrong side of their labels.&lt;/p&gt;

&lt;p&gt;Here are the lessons that have saved us the most time when building bilingual themes.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Set the direction once, at the root
&lt;/h2&gt;

&lt;p&gt;Do not sprinkle &lt;code&gt;dir="rtl"&lt;/code&gt; across individual sections. Set it on the &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt; element based on the active locale, so the whole document flips consistently:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight liquid"&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;liquid&lt;/span&gt;
  &lt;span class="n"&gt;assign&lt;/span&gt; &lt;span class="n"&gt;rtl_locales&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'ar,he,fa,ur'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;','&lt;/span&gt;
  &lt;span class="n"&gt;assign&lt;/span&gt; &lt;span class="n"&gt;page_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'ltr'&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;rtl_locales&lt;/span&gt; &lt;span class="n"&gt;contains&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;locale&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;iso_code&lt;/span&gt;
    &lt;span class="n"&gt;assign&lt;/span&gt; &lt;span class="n"&gt;page_dir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'rtl'&lt;/span&gt;
  &lt;span class="n"&gt;endif&lt;/span&gt;
&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&lt;/span&gt; &lt;span class="na"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"{{ request.locale.iso_code }}"&lt;/span&gt; &lt;span class="na"&gt;dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"{{ page_dir }}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With direction set at the root, the browser handles text alignment, table columns and form fields for you. Your job becomes fixing the places where the CSS fights the browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Replace physical CSS properties with logical ones
&lt;/h2&gt;

&lt;p&gt;The single biggest improvement is moving from &lt;code&gt;left&lt;/code&gt;/&lt;code&gt;right&lt;/code&gt; to logical properties. Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card__badge&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;left&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.price&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;margin-right&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.card__badge&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;inset-inline-start&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;12px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;.price&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;margin-inline-end&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;text-align&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;margin-inline-start&lt;/code&gt;, &lt;code&gt;padding-inline-end&lt;/code&gt;, &lt;code&gt;inset-inline-start&lt;/code&gt;, &lt;code&gt;border-inline-start&lt;/code&gt; and &lt;code&gt;text-align: start&lt;/code&gt; all follow the document direction automatically. One stylesheet now works for both languages, and you avoid maintaining a separate &lt;code&gt;rtl.css&lt;/code&gt; file that drifts out of sync.&lt;/p&gt;

&lt;p&gt;Browser support for logical properties is excellent in every evergreen browser, so there is little reason to avoid them on new builds.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Flip directional icons, not all icons
&lt;/h2&gt;

&lt;p&gt;Arrows, chevrons and "back" icons should mirror in RTL. Search, cart, user and close icons should not. A small utility class keeps this explicit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;dir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"rtl"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nc"&gt;.icon--directional&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;transform&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nf"&gt;scaleX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Apply &lt;code&gt;icon--directional&lt;/code&gt; only to icons that imply movement or reading order. Logos, product images and anything containing Latin text should never be flipped.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Watch out for sliders and JavaScript positioning
&lt;/h2&gt;

&lt;p&gt;Carousel libraries often calculate positions with &lt;code&gt;scrollLeft&lt;/code&gt; or translate values that assume left-to-right flow. Before shipping:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;check whether your slider library has an RTL option and pass it based on &lt;code&gt;document.dir&lt;/code&gt;,&lt;/li&gt;
&lt;li&gt;test swipe gestures on a real phone, because swipe direction should feel natural for Arabic readers, and&lt;/li&gt;
&lt;li&gt;check &lt;code&gt;scrollLeft&lt;/code&gt; behaviour, since browsers report negative values in RTL containers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A quick guard in your theme JavaScript helps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;isRTL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;documentElement&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dir&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s1"&gt;'rtl'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;slider&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rtl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;isRTL&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Handle mixed-direction content carefully
&lt;/h2&gt;

&lt;p&gt;Product titles in Arabic stores often contain English brand names, model numbers or sizes. The Unicode bidirectional algorithm usually copes, but numbers and punctuation at the edges of a string can jump to the wrong side. Wrap user-generated or mixed values with &lt;code&gt;&amp;lt;bdi&amp;gt;&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight liquid"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"product-sku"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;bdi&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;{{&lt;/span&gt; &lt;span class="n"&gt;variant&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sku&lt;/span&gt; &lt;span class="cp"&gt;}}&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/bdi&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Prices deserve extra testing. Check how the currency code or symbol renders next to Arabic text, and make sure phone numbers in the footer stay readable in both directions.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Choose fonts that support Arabic properly
&lt;/h2&gt;

&lt;p&gt;Many popular Latin web fonts have no Arabic glyphs, so the browser falls back to a system font and the store suddenly looks inconsistent. Pick a pairing with a proper Arabic companion, set it with a locale-based class, and increase the line height slightly. Arabic script generally needs more vertical space to stay readable.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;lang&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"ar"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;font-family&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Noto Kufi Arabic'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system-ui&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;sans-serif&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;line-height&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;1.8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Test the whole purchase path, not just the homepage
&lt;/h2&gt;

&lt;p&gt;The homepage is usually fine after the steps above. Problems hide in the cart drawer, quantity selectors, filters, account pages and the order confirmation email. Walk through a complete order in Arabic on mobile before calling the job done.&lt;/p&gt;

&lt;h2&gt;
  
  
  Closing thoughts
&lt;/h2&gt;

&lt;p&gt;RTL support is much easier when it is planned from the first line of CSS rather than patched at the end. Set the direction at the root, use logical properties, be deliberate about icons and sliders, and test real purchase flows. If you would rather hand the work to a team that does this regularly, a specialist &lt;a href="https://digitalgraphiks.ae/cms-development/shopify" rel="noopener noreferrer"&gt;Shopify Development Dubai&lt;/a&gt; studio can build bilingual themes from the ground up, and the same principles apply to any custom &lt;a href="https://digitalgraphiks.ae/" rel="noopener noreferrer"&gt;Web Design Dubai&lt;/a&gt; project that has to serve both Arabic and English audiences.&lt;/p&gt;

</description>
      <category>css</category>
      <category>frontend</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
