iAdvize
Back

The widget now follows the page's language, not just the shopper's browser

Changed

Until now, the widget picked its display language from the shopper's browser alone. On a multilingual storefront, that meant a shopper with an English browser visiting your French pages saw an English launcher and composer over a French page, even though the page itself declared its language correctly.

The widget now checks the page first: it reads the page's own <html lang> attribute and uses it, falling back to the shopper's browser language only when the page doesn't declare one your site supports. This is automatic: most storefronts already declare the right lang per locale, so there's nothing to configure.

If a page's lang attribute is wrong (a theme that hard-codes lang="en" everywhere, say) or you want to force a language regardless of the page or the browser, call iadvize('set', { locale: 'fr' }) before the loader boots. A shopper already mid-conversation keeps the language that conversation started in, even after navigating to a page in another language.

If your own code reads config.locale from the tag's config:loaded event, note the format changed: it used to be a dashboard-style regional tag (fr-FR), it's now a plain site language code (fr) reflecting the language actually displayed.

Resources