Contents
Localization
Genesys Widgets allow for localization of 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 you can configure in the window_genesys.cxwidget.main section.
Example:
<script>
if(!window._genesys)window._genesys = {};
if(!window._gt)window._gt = [];
window._genesys.cxwidget = {
main: {
theme: "dark",
lang: "en",
// Enter a URL that points to
i18n: "http://HOST:PORT/path/to/lanaguages/file.json"
// OR define the JSON object inline
i18n: {
"en": {
webchat: {
"ChatStarted": "Chat Started",
"ChatEnded": "Chat Ended",
...
}
}
}
}
};
</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 (external file)
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
main.i18n (inline object)
Type: object
Default: built-in English words and phrases
Requirement: Optional
Description: Define the JSON localization object inline directly. Can be partial or complete. Unspecified strings will use default values.
Language Pack JSON Format
The Language Pack is written in JSON format.
// Root
{
// Language Code
"en": {
// Widget name
"webchat": {
// Localized strings
"ChatStarted": "Chat Started",
"ChatEnded": "Chat Ended",
"ChatFailed": "There was a problem starting the chat session. Please Retry.",
// Customer Defined Strings - Match & Replace messages received from chat server
"SYS0001": "An Agent will be with you shortly"
}
}
}
Language Codes
To allow flexibility in the way that 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. The language code that you set in window._genesys.cxwidget.main.lang must correlate to a language code in the Language Pack File.
Webchat Localization
// Widget name
"webchat": {
// Localized strings
"ChatStarted": "Chat Started",
"ChatEnded": "Chat Ended",
"ChatFailed": "There was a problem starting the chat session. Please Retry.",
"ChatFailedRetry": "Retry",
"ChatFailedClose": "Close",
"UserNameDefault": "Anonymous",
"AgentNameDefault": "Agent",
"AgentConnected": "<%Agent%> Connected",
"AgentDisconnected": "<%Agent%> Disconnected",
"AgentTyping": "...",
"AgentPending": "An Agent will be with you shortly",
"AgentUnavailable": "Sorry. There are no agents available. Please try later",
"ChatTitle": "Live Chat",
"ChatEnd": "X",
"ChatClose": "X",
"ChatMinimize": "Min",
"ChatFormFirstName": "First Name",
"ChatFormLastName": "Last Name",
"ChatFormNickname": "Nickname",
"ChatFormEmail": "Email",
"ChatFormSubject": "Subject",
"ChatFormPlaceholderFirstName": "Optional",
"ChatFormPlaceholderLastName": "Optional",
"ChatFormPlaceholderNickname": "Optional",
"ChatFormPlaceholderEmail": "Optional",
"ChatFormPlaceholderSubject": "Optional",
"ChatFormSubmit": "Start Chat",
"ChatFormCancel": "Cancel",
"ChatInputPlaceholder": "Type your message here and hit return",
"ChatInputSend": "SEND",
"ChatEndQuestion": "Are you sure you want to end this chat session?",
"ChatEndCancel": "Cancel",
"ChatEndConfirm": "End chat",
"ActionsDownload": "Download transcript",
"ActionsEmail": "Email transcript",
"ActionsPrint": "Print transcript",
"ActionsCobrowseStart": "Start Co-browse",
"ActionsCobrowseStop": "Exit Co-browse",
"ActionsVideo": "Invite to Video Chat",
"InviteTitle": "Need help?",
"InviteBody": "Let us know if we can help out.",
"InviteReject": "No thanks",
"InviteAccept": "Start chat",
"EndConfirmBody": "Would you really like to end your chat session?",
"EndConfirmAccept": "End chat",
"EndConfirmReject": "Cancel",
// Customer Defined Strings - Match & Replace messages received from chat server
"SYS0001": "An Agent will be with you shortly"
}Customer Defined Strings
You can define string key names and values to match the system messages that are received from the chat server. If a customer system message is received as SYS001 in the message body, Webchat checks to determine if any keys match in the language pack, and then replaces the message body accordingly. SYS001 is an example format. There are no format restrictions on custom message keys. The purpose of this feature is to allow localization for the User Interface and Server to be kept in the same 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.
Co-browse Localization
// Widget name
"cobrowse": {
// Localized strings
"agentJoined": "Representative has joined the session",
"youLeft": "You have left the session. Co-browse is now terminated.",
"sessionTimedOut": "Session timed out. Co-browse is now terminated.",
"sessionInactiveTimedOut": "Session timed out. Co-browse is now terminated.",
"agentLeft": "Representative has left the session. Co-browse is now terminated.",
"sessionError": "Unexpected error occured. Co-browse is now terminated.",
"serverUnavailable": "Could not reach Co-browse server. Co-browse is now terminated.",
"sessionStarted": "Your co-browse session ID is {sessionId}. Please spell it to our representative to continue with co-browsing.",
"navRefresh": "Representative has refreshed the page. Reloading.",
"navBack": "Representative has pressed the \"Back\" button. Reloading page.",
"navForward": "Representative has pressed the \"Forward\" button. Reloading page.",
"navUrl": "Representative has requested navigation. Reloading page.",
"navFailed": "Navigation request by representative has failed.",
"toolbarContent": "Session ID: {sessionId}",
"contentMasked": "Content is hidden from representative",
"contentMaskedPartially": "Some content is hidden from representative",
"exitBtnTitle": "Exit Co-browse session",
"areYouOnPhone": "Are you on the phone with our representative?",
"areYouOnPhoneOrChat": "Are you on the phone or chat with our representative?",
"connectBeforeCobrowse": "You need to be connected with our representative to continue with co-browsing. Please call us or start a live chat with us, and then start Co-browse again.",
"sessionStartedAutoConnect": "Co-browse session started. Waiting for representative to connect to the session…",
"browserUnsupported": "Unfortunately, your browser is not currently supported.<br><br> Supported browsers are: <ul><li><a target='_blank' href='http://www.google.com/chrome'>Google Chrome</a></li><li><a target='_blank' href='http://www.firefox.com/'>Mozilla Firefox</a></li><li><a target='_blank' href='http://microsoft.com/ie'>Internet Explorer 9 and above</a></li><li><a target='_blank' href='https://www.apple.com/safari'>Safari 6 and above</a></li></ul>",
"modalTitle": "Co-browse",
"modalYes": "Yes",
"modalNo": "No",
"writeModeInProgress": "Agent has control over the page.",
"downgradeMode": "Revoke control",
"modeUpgraded": "Co-browse session was upgraded. Agent has control over the page.",
"modeDowngraded": "Co-browse session was downgraded. Agent has no control",
"modeUpgradeRequested": "Agent requests upgrading Co-browse session to \"write\" mode. In \"write\" mode agent will have control over the page."
}
Special Values for Localization
You can inject the {sessionId} special value. When used, the Co-browse session ID number is rendered in its place at runtime.
