Localization
Genesys Widgets allow for localizing user messages and prompts. First, you must create and host a Language Pack that Genesys Widgets can access and use. The Language Pack is a file written in JSON format. Specify your Language Pack file by using Genesys Widgets configuration options, which are set in the window_genesys.cxwidget.main section.
<script>
if (!window._genesys)
window._genesys = {};
window._genesys.cxwidget = {
main: {
theme: "dark",
lang: "en",
i18n: "http://HOST:PORT/path/to/lanaguages/file.json"
}
};
</script>Configuration Options
main.lang
Type: string
Default: "en"
Requirement: Optional
Description: A language code to specify which language to display in the Widgets. Language codes are set by the customer.
main.i18n
Type: string
Default: built-in English words and phrases
Requirement: Optional
Description: A URL that the Widgets use to fetch the Language Pack file upon startup.
Language Pack File Format
The Language Pack File is written in JSON format.
// Root
{
// Language Code
"en":{
// Widget name
"webchat": {
// Localized strings
"ChatStarted": "Chat Started",
"ChatEnded": "Chat Ended",
"ChatFailed": "Failed to Start Chat Session",
"UserNameDefault": "Anonymous",
"AgentNameDefault": "Agent",
"AgentConnected": "<%Agent%> Connected",
"AgentDisconnected": "<%Agent%> Disconnected",
"AgentTyping": "<%Agent%> is typing",
"AgentPending": "An Agent will be with you shortly",
"AgentUnavailable": "Sorry. There are no agents available. Please try later",
"ChatTitle": "Chat Support",
"ChatFormFirstName": "First Name",
"ChatFormLastName": "Last Name",
"ChatFormEmail": "Email",
"ChatFormSubject": "Subject",
"ChatFormSubmit": "Start Chat",
"ChatInputPlaceholder": "Type your message here and hit return...",
"ChatInputSend": "SEND",
"CoBrowseStart": "Start Cobrowse"
}
}
}Language Codes
To allow flexibility in the way your website currently handles multiple languages and language codes, there are no rules for language codes other than that they must be strings. You can use any language code system. Whatever language code you set in window._genesys.cxwidget.main.lang must correlate to a language code in the Language Pack File.
Special Values for Localization
You can inject the <%Agent%> special value. When used, the agent's name is rendered in its place at runtime.
