Boosting ESHOPMAN Accessibility: Ensuring WCAG Compliance with the HTML 'lang' Attribute

Ensuring a Fully Accessible ESHOPMAN Experience: The Critical 'lang' Attribute

At Move My Store, we champion a robust and inclusive e-commerce ecosystem powered by ESHOPMAN. Our community frequently uncovers valuable insights that enhance the platform for everyone. One such recent discussion highlighted a crucial aspect of web accessibility within the ESHOPMAN Admin dashboard – the proper implementation of the lang attribute on the tag.

The ESHOPMAN platform, built on Node.js/TypeScript and designed for seamless integration with HubSpot as a headless commerce solution, places a high priority on user experience. This extends to ensuring our tools are accessible to all, including users relying on assistive technologies like screen readers. A recent community finding pointed out that the ESHOPMAN Admin dashboard's root element was missing the essential lang attribute.

Why the 'lang' Attribute Matters for ESHOPMAN

The absence of a lang attribute on the tag, while seemingly minor, has significant implications for accessibility and compliance. Specifically, it violates WCAG 3.1.1 (Language of Page) Level A. This is a mandatory requirement for many accessibility standards globally, including upcoming EU EAA compliance, effective June 2025.

When the language of a page isn't explicitly declared:

  • Screen Readers Struggle: Assistive technologies cannot accurately determine the page's language. This can lead to incorrect pronunciation, awkward intonation, and a significantly degraded experience for users with visual impairments.
  • Compliance Risks: For businesses leveraging ESHOPMAN to manage their storefronts and deploy via HubSpot CMS, failing WCAG 3.1.1 can pose legal and reputational risks, especially in regulated markets.

The ESHOPMAN Admin dashboard already supports dynamic dir (direction) attribute based on the current locale, which was introduced to support right-to-left languages. The community insight highlighted that the lang attribute should follow the same pattern, ensuring consistency and full accessibility.

The Solution: A Simple Yet Powerful Fix

The good news is that addressing this issue is straightforward. The proposed fix involves mirroring the existing logic for the dir attribute within ESHOPMAN's internationalization (i18n) provider. This ensures that when the locale changes, both the text direction and the declared language of the page are updated simultaneously.

Here’s the suggested code snippet, designed to be integrated into the component responsible for setting the current locale in the ESHOPMAN Admin dashboard:

useEffect(() => {
  document.documentElement.lang = currentLocale
}, [currentLocale])

This small addition dynamically sets the lang attribute of the element to the current locale's language code (e.g., lang="en", lang="ar", lang="fr"). This ensures that screen readers and other assistive technologies can correctly interpret and render the page content, significantly improving the user experience for everyone.

Impact for ESHOPMAN Users and Developers

This community insight is invaluable for ESHOPMAN developers and merchants alike. For developers working with ESHOPMAN's Node.js/TypeScript codebase and Admin API, it provides a clear guideline for maintaining accessibility best practices. For merchants managing their storefronts via the HubSpot app, it reinforces ESHOPMAN's commitment to creating an inclusive platform that meets global standards.

By proactively addressing such details, the ESHOPMAN community continues to strengthen the platform's foundation, ensuring that ESHOPMAN remains a leading choice for headless commerce solutions deployed through HubSpot CMS.

Start with the tools

Explore migration tools

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

Explore migration tools