Freshchat supports multiple languages and the widget can automatically detect the supported languages.


The list of all supported languages and their keys are provided in the list below.


CodeLanguage    CodeLanguageCodeLanguageCode Language
arArabicenEnglishlvLatvianslSlovenian
caCatalanetEstoniannoNorwegianesSpanish
zh_HANSChinese (Simplified)fiFinnishplPolishes-LASpanish - Latin America
zh_HANTChinese (Traditional)frFrenchptPortuguesesvSwedish
csCzechhuHungarianpt-BRPortuguese - BrazilthThai
daDanishidIndonesianroRomaniantrTurkish
nlDutchitItalianruRussianukUkranian
deGermankoKoreanskSlovakviVietnamese


The language is based on priority and they are explained below.


1. config language


First priority is given to the specified language. This can be done when you add the Freshchat widget code.


For instance, in the below code the key locale is used to set the language when the widget in initalized.


<html>


<head>


  <script src="https://wchat.freshchat.com/js/widget.js"></script>


</head>


<body>


<script>


  window.fcWidget.init({


    token: "8d3a4a04-5562-4f59-8f66-f84a269897a1",


    host: "https://wchat.freshchat.com",


    locale: "fr"


  });


</script>


</body>


</html>


Another example for using the key locale is provided below.


<script>


  window.fcSettings = {


    token: "8d3a4a04-5562-4f59-8f66-f84a269897a1",


    host: "https://wchat.freshchat.com",


    locale: "fr"


  };


</script>


<script src="https://wchat.freshchat.com/js/widget.js" async></script>


This will also be useful if your website has a language dropdown, you can use the below option to change the widget's language on the fly.


window.fcWidget.user.setLocale('en')


So when the dropdown is change, based on the dropdown value, the widget language can also be specified.


$('#lang-btn').on('change',function() {


    var selectedLanguage = jQuery(this).val();


    window.fcWidget.user.setLocal(selectedLanguage);


});


2. Browser language


If there is no language specified on config, the widget will pick the browser language automatically. If there are multiple languages set on the browser it will take the primary language always.


3. OS language


If the browser language is not available, then the next step for fall back is the Operating System Language.


4. Default language


In case all the above three values are not available Freshchat will automatically load the widget in the default language. This will be the primary language that is specified on the Freshchat App.