How to use Webchat with Different Teams and Languages

You can create a team for each language that will require support. 

If the target website uses different URLs or domains for different languages. 

For example: https://website.com/en/games.html / https://website.com/jp/games.html

Paste the code of the team that is assigned to the specified language to the adjacent URL or domain (the code can be found in ChatCenter settings under the team setting). 

When users visit /jp/games.html the website source code contains the code generated for Team JP.

If the target website does not use unique URLs for different languages. 

If the target website does not use unique URLs for different languages and instead uses javascript to handle website localizations, we need to switch the team programmatically using Sinitic webchat API.

If you need further assistance with this, please reach out to the Sinitic team by clicking here and we'll be happy to help. 


Changing the agent team

To switch a team, you can call javascript function

 window.$sinitic.api('setTeam', ateamId) with ateamId from the generated code snippet

The following example demonstrates the use of Webchat and the results of when a website language is switched:

  1. User visits https://website.com/en/about

  2. The website loads javascript code generated by the Sinitic platform with ateamId: ateam_JY7e8w

  3. The user switches the website language to Japanese

     a. If the website redirects to https://website.com/jp/about, then a new code is loaded with ateamId: ateam_eT4BF9

     b. If the website does not redirect and only changes the language setting in javascript, the website needs to call the method $sinitic.api(‘setTeam’, ’ateam_eT4BF9’)

  4. All following conversations will be assigned to the team with id ateam_eT4BF9

Note: Teams cannot be switched amidst an active conversation, for the change of a team to take effect, the conversation needs to be closed and then reopened.


Changing the language of webchat UI and the welcome screen 

We support the following display language:

Language

code

English

en

Traditional Chinese

zh_TW

Simplified Chinese

zh_CN

Japanese

jp

Vietmanese

vi

Indoesian

in

Thai

th

Default UI language is the master language of your bot. 

If you need to change it lively, you can call $sinitic.api('setLang', code)


Toggle Chat Window 

We also provide toggleChat api to contorl the chat window.

$sinitic.api('toggleChat', true)opens the chat window

$sinitic.api('toggleChat', false)closes the chat window

$sinitic.api('toggleChat')switches between open and close

Open

Closed


Webchat (open)


Webchat (closed)


Was this article helpful?

Can’t find what you’re looking for?

The Sinitic team is here for you.

Contact Support