By default, Crisp auto sets the chatbox language based on the visitor web browser language. You can even force a global language in the website settings. If, however, your website is localized in multiple languages, and you'd like to force chatbox language based on the current language of your website, you may want to use the Crisp JavaScript API.

How to force locale

This configuration can be forced by adding a locale parameter to the special variable CRISP_RUNTIME_CONFIG, as follows (for French):

CRISP_RUNTIME_CONFIG = {
locale : "fr"
};


The locale code follows the ISO 639-1 format.

Add this JavaScript code right in the Crisp chatbox HTML code in the <script></script> tag.

Want to know more about the $crisp interface? Read: How to use $crisp Javascript SDK?

Any trouble?

If you cannot get the locale to be forced this way, check that chatbox locales are not restricted. Go to your website configuration:

Go to: https://app.crisp.chat
Go to your settings: click on the settings icon
Click on "Websites"
Select your website in the list
Look for the locales configuration box and select "Detect from visitor country"
Was this article helpful?
Thank you!