TABLE OF CONTENTS
Localization
Localization is the feature where your agents and users can view content on Freshchat in their preferred language. As part of Localization settings, the application takes care of text (Internationalization), dates, numbers, and timestamps.
Freshchat conversations widget (web messenger)
The Freshchat conversations widget (web messenger) will be displayed based on the user’s browser language (also referred to as locale)
Supported Locales
The Freshchat conversations widget (web messenger) currently supports the following locales.
When the Freshchat conversations widget (web messenger) is loaded for the first time, it automatically matches the user’s browser locale with the supported list and renders the content. For example, if the browser locale is Spanish, the header will be “Envíenos un mensaje” instead of “Message Us” on page load.
The messenger will fall back to English if the browser locale is not supported.
Locale values based on countries are different. For example, the English language has locale values ‘en-us’ for American English and ‘en-gb’ for British English. The default English locale code for Freshchat is ‘en-us’. Even if the user’s browser locale is ‘en-gb’, it will automatically map it to ‘en-us.’ This is the case for other locales too.
Note: Freshchat localization has Right-To-Left (RTL) support for Arabic and Hebrew languages
Override Options
The Messenger locale can be overridden in the following ways.
Note: To find the tracking code that you need to include before the tag of the web pages you want to integrate, navigate to Admin Settings > Configuration and Workflows > CRM Tracking Code > Add CRM Tracking Code to your website > Copy
1. Messenger Initialization
Set “locale” property in the window.fcWidget.init function as shown below.
<script>
window.fcWidgetMessengerConfig = {
locale: "fr"
}
</script>
<script src='//fw-cdn.com/1*****7/2*****4.js' chat='true'></script>
2. User update action
You can also set the language programmatically using the setLocale function.
window.fcWidget.user.setLocale(selectedLanguage)
Make sure selectedLanguage is one of the supported locales listed in the Supported locales table.
<!--Body-->
<script src='//fw-cdn.com/1*****7/2*****4.js' chat='true'></script>
<script>
//Consider a dropdown with id #lang-btn to select the language
$('#lang-btn').on('change',function() {
var selectedLanguage = jQuery(this).val();
//Setting the Widget Locale
window.fcWidget.user.setLocale(selectedLanguage);//Replace selectedLanguage with preferred language such as ‘fr’
});
</script>
<!--Body→>
Note: If there is more than one browser locale enabled, Freshchat will always consider the default (primary) language.