If you want to communicate with your website visitors in languages other than English, you can now use visitor APIs and customise your chat window to your preferred language.


You can modify three types of content in your chat window: 


Parts of a chat window.png

Fig 1: Types of chat widget content you can modify


How to use Freshchat functions


To begin, you must copy the Freshchat script for the widget. You can access the script in your Freshchat Settings page: Settings > Installation Snippet.


Once you paste the script into your website, ensure you call Freshchat functions after the script loads onto your web page. 


These are some of the ways in which you can access Freshchat functions:


window.onload = function(){

//Freshchat functions

}



If you are using jquery,


$(window).load(function(){

//Freshchat functions

})



Or, if you’re using Onreadystatechange event,


document.onreadystatechange = function(){

if(document.readystate === ‘complete’){

//Freshchat functions

}

}


How to modify header: 


When a user is online: 


In the setWidgetProperties() function, against the online_header attribute, insert the text in your preferred language.

Online header code.png

Fig 2: online_header attribute inside the function



German online header.png

Fig 3: Online header - UI



When all users are offline: 


In the setWidgetProperties() function, against the offline_header attribute, insert the text in your preferred language.

Offline header code.png

Fig 4: offline_header attribute inside the function


Offline header.png

Fig 5: Offline header - UI


How to modify messages: 


In the setWidgetProperties() function, insert the text in your preferred language against the following attributes: 


Status of chat

Attribute

Scenario

Sample text

Active

online_welcome_msg

Welcome the visitor when at least one user is online

Hi, have a question? Go ahead and ask away.

getcontext_msg

Request the visitor for details like name/email/phone number/any other (if details are not already available)

Before we jump in, could you let us know your email id?

online_onhold_msg

Request the visitor to stay online when user is busy

We will be with you in a few minutes.

chat_transfer_msg

Inform the visitor that the chat is being transferred to another user

Christina will take over the chat now.


Note: ‘Christina’ is a variable whose value depends on the context. To make this value context-dependent, use curly brackets where user's name is to be inserted. For example: {{user name}} will take over the chat now.

end_chat_confirm_msg

Confirm end of conversation with visitor

Are you sure you want to end this chat?

Missed

missed_msg

User is online but misses the visitor’s ping

We are so sorry, we are currently unavailable :( We have all your messages, please leave us any additional details and we will get back to you by email.

missed_additional_msg

Request visitor to provide basic details for follow up (if details are not already available)

Thanks! Can you help us with your email id so that we can get back to you?

missed_thankyou_msg

Details obtained/available; commitment made to visitor that user will revert

Thank you! We look forward to talking to you in a bit.

Offline

offline_welcome_msg

To initiate engagement with visitor when all users are offline

Hi and welcome :) Leave us a message here and we will get back to you by email.

offline_additional_msg

Request visitor to provide basic details for follow up (if details are not already available)

Thanks! Can you help us with your email id so we can get back to you?

offline_thankyou_msg

Details obtained/available; commitment made to visitor that user will revert

Thank you! Let's talk soon.



Messages code.png

Fig 6: Inserting messages in preferred language


Messages in French.png

Fig 7: Inserting messages in preferred language - UI


How to modify fields:


In the setWidgetProperties() function, insert the text in your preferred language against the following attributes:


Attribute

Purpose

Sample text

textbox_placeholder

Directing the visitor to type a message

Type your message here

getcontext_name

Requesting for visitor’s name

Name

getcontext_email

Requesting for visitor’s email

Email

getcontext_phone

Requesting for visitor’s phone number

Phone Number

getcontext_textfield

Requesting visitor to specify subject he wants to discuss

What subject would you like to discuss?



Type your message in French code screen.png

Fig 8: Fields in preferred language (Use case 1)


Type in French UI screen.png

Fig 9: Fields in preferred language (Use case 1) - UI


Fields code screenshot.png

Fig 10: Fields in preferred language (Use case 2)


Fields in native language UI screenshot.png

Fig 11: Fields in preferred language (Use case 2) - UI