Forcing language selection in your storefront

If you have a multilingual catalog, Ecwid automatically detects the preferred language of your customers’ browsers and shows your store in that language.

In some cases, you might want to add your store in a specific language to a webpage, regardless of the browser language detection. You can force a language by following these steps:

  1. Enable the necessary language in your store and translate your catalog into it;
  2. Add the "lang" GET variable to all inclusions of the "script.js" file in Ecwid widgets in the source code of your web page:

<script type="text/javascript" src="https://app.ecwid.com/script.js?
YOUR_STORE_ID&lang=LOCALE_CODE" charset="utf-8">
</script>

Replace YOUR_STORE_ID with your actual Store ID and LOCALE_CODE with the code of the necessary language, for example, en, es, fr, de. See the list of ISO 639-1 language codes to find the two-letter code of the language you wish to force.

Example: You’ve enabled French as an additional language, added your catalog translations into French and wish to show your whole store in French to everyone in a certain site page. In this case, your Ecwid widget in that webpage source code must contain the lang=fr variable:


<script type="text/javascript" src="https://app.ecwid.com/script.js?
1003&lang=fr" charset="utf-8">
</script>
If you’ve added your multilingual Ecwid store to a multilingual Wix site or to a multilingual Wordpress site, your customers can use their language switcher to change the language for the entire site, including the store.
If you want to always display your store to all store visitors in one language only, you should remove additional languages, if any, and set the necessary language as the default store language.

Related articles

Offering your store in multiple languages
Changing your store language
Changing texts in your Ecwid store

Was this article helpful?

Awesome! Thanks for your feedback!

Sorry about that! We are here to assist you by email or chat.

Contact support