Using Webchat and ChatCenter with Different Teams and Languages
Last updated
Last updated
Create a team for each language that will require support.
If the target website uses different URLs or domains for different languages. i.e.: 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.
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:
User visits https://website.com/en/about
The website loads javascript code generated by the Sinitic platform with ateamId:
ateam_JY7e8w
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’
)
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.
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)
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