Chatbox SDKs | Web Chat SDK
Give Feedback

Language Customization

Updated on September 21, 2021

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 would 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 a 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.

Ensure the CRISP_RUNTIME_CONFIG configuration is included before the Crisp widget.

Add this JavaScript code in the Crisp chatbox HTML code in the <script></script> tag, as follows:

<script type="text/javascript">
  CRISP_RUNTIME_CONFIG = {
    locale : "fr"
  };

  window.$crisp=[];window.CRISP_WEBSITE_ID="xxx-xxx";(function(){d=document;s=d.createElement("script");s.src="https://client.crisp.chat/l.js";s.async=1;d.getElementsByTagName("head")[0].appendChild(s);})();
</script>
Want to know more about the $crisp interface? Read our guide about it.

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 your Crisp Dashboard
  • 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"