e-commerce

Beyond Borders: ESHOPMAN's Flawless RTL Experience for Headless Commerce on HubSpot

As an e-commerce platform designed to empower merchants globally, ESHOPMAN is committed to providing a seamless experience for storefront management, regardless of language or region. Our platform, built on Node.js/TypeScript and integrated with HubSpot CMS, ensures that managing your headless commerce operations is intuitive and efficient. A crucial aspect of this commitment is robust support for Right-to-Left (RTL) languages.

Recently, our vibrant ESHOPMAN community identified and proposed a significant enhancement to how our core UI components render and behave in RTL locales. This discussion highlights the dedication of our developer community to refining the ESHOPMAN experience for a truly global audience, ensuring that every merchant, everywhere, can manage their online store with unparalleled ease within the HubSpot ecosystem.

ESHOPMAN Admin Hub interface demonstrating correct LTR and RTL layout mirroring
ESHOPMAN Admin Hub interface demonstrating correct LTR and RTL layout mirroring

The Global E-commerce Imperative: Why RTL Matters for Your HubSpot Storefront

In today's interconnected world, expanding your e-commerce reach means catering to diverse linguistic and cultural preferences. For a significant portion of the global population, reading and writing flows from right to left. Languages like Arabic, Hebrew, and Persian are not just different in script; they fundamentally alter the visual hierarchy and interaction patterns of a user interface. For a headless commerce platform like ESHOPMAN, which empowers storefront management directly within HubSpot and deploys via HubSpot CMS, neglecting proper RTL implementation can severely hinder user experience and market penetration.

The ESHOPMAN Admin Hub, where you manage your products, orders, and storefronts within HubSpot, supports various languages. While the document's direction was correctly set to dir="rtl" for these locales, initial implementations presented a core challenge that our community was quick to address.

Unpacking the Challenge: Physical vs. Logical UI Direction in ESHOPMAN

The journey to truly seamless RTL support involved a deep dive into the foundational elements of our UI. The primary hurdle stemmed from the reliance on physical direction properties in our component styling and behavior.

The Pitfalls of Physical Direction Classes

ESHOPMAN's UI components were utilizing physical direction classes for styling. For instance, properties like ml- for margin-left, pr- for padding-right, left-0 for absolute positioning, text-left for text alignment, and rounded-l for left-side rounding were common. In an LTR (Left-to-Right) context, these work perfectly. However, when the entire document direction shifts to RTL, these physical directions cause elements to appear on the wrong side. Imagine:

  • An icon meant to be on the leading edge of a button appearing on the trailing edge.
  • Spacing that pushes content away from the center instead of towards it.
  • Borders and rounded corners that don't follow the natural reading flow.
  • Text alignment that feels unnatural and disjointed.

This led to misaligned icons, incorrect spacing, and borders that simply didn't follow the reading flow, creating a frustrating and inefficient experience for merchants managing their stores in HubSpot.

The Disconnect in Core UI Primitives

Beyond static styling, many of the foundational UI primitives within the ESHOPMAN Admin Hub – such as those used for select menus, dropdowns, tooltips, popovers, tabs, and radio groups – were not inheriting the application's direction. This meant that their keyboard navigation and positioning logic remained Left-to-Right (LTR), even when the visual elements were attempting to adapt. This created a disjointed user experience where visual cues and interactive behaviors were out of sync, hindering productivity for merchants using the ESHOPMAN HubSpot app.

ESHOPMAN's Solution: Embracing Logical Properties for True Directionality

To overcome these challenges and deliver a truly global experience, ESHOPMAN embarked on a strategic shift towards logical properties in its UI framework. This approach is fundamental to how our Node.js/TypeScript platform ensures adaptability across all languages.

Instead of physical directions, we now leverage logical properties that automatically adapt based on the document's writing mode and direction. For example:

  • margin-inline-start replaces margin-left (or margin-right in RTL).
  • padding-inline-end replaces padding-right (or padding-left in RTL).
  • inset-inline-start replaces left-0 (or right-0 in RTL).
  • text-align: start replaces text-left (or text-right in RTL).
  • border-start-start-radius replaces border-top-left-radius (or border-top-right-radius in RTL).

This fundamental change means that our UI components, from the smallest button to the most complex form, inherently understand and respect the document's direction. The ESHOPMAN Admin API and Store API are designed to support this flexibility, ensuring that the data and presentation layers are always in sync.

Furthermore, our engineering team meticulously re-engineered the underlying UI primitives. This involved ensuring that interactive elements like dropdowns and tooltips not only visually adapt but also respond to keyboard navigation and positioning logic that aligns with the current text direction. This holistic approach guarantees a consistent and intuitive experience, whether you're managing your storefront in English or Arabic within the HubSpot environment.

/* Example of a logical property in CSS */
.my-component {
  margin-inline-start: 1rem; /* Equivalent to margin-left in LTR, margin-right in RTL */
  padding-inline-end: 0.5rem; /* Equivalent to padding-right in LTR, padding-left in RTL */
  text-align: start; /* Equivalent to text-align: left in LTR, text-align: right in RTL */
}

The Impact: A Truly Global Headless Commerce Experience on HubSpot

The shift to logical properties and the comprehensive re-engineering of UI primitives have profound benefits for ESHOPMAN merchants and their customers:

Enhanced User Experience for Merchants

Merchants managing their headless commerce operations within the ESHOPMAN HubSpot app now enjoy a truly localized and intuitive experience. The Admin Hub feels natural and responsive, regardless of the chosen language, eliminating the frustrations of misaligned elements and inconsistent interactions.

Wider Market Reach and Customer Satisfaction

By providing flawless RTL support, ESHOPMAN empowers merchants to confidently target and serve RTL-speaking regions. This extends your potential customer base significantly, offering a superior shopping experience on storefronts deployed via HubSpot CMS, which translates directly into higher engagement and conversion rates.

Streamlined Management and Development

For developers building on ESHOPMAN's Node.js/TypeScript foundation, this approach simplifies development and maintenance. Components are inherently direction-aware, reducing the need for complex conditional styling and ensuring future enhancements automatically support all language directions. This consistency extends across the Admin API and Store API, making development more efficient.

Consistency Across the Ecosystem

From the ESHOPMAN Admin Hub within HubSpot to the live storefronts deployed via HubSpot CMS, a unified, direction-aware experience is maintained. This consistency builds trust and provides a professional, polished brand image for your e-commerce business.

ESHOPMAN's commitment to robust RTL support is more than just a technical feature; it's a testament to our dedication to global inclusivity and providing a powerful, intuitive headless commerce solution integrated seamlessly with HubSpot. We believe that every merchant, regardless of their language or location, deserves a platform that empowers them to succeed without compromise.

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools