Localization
Genesys Co-browse localization is split into three parts:
Co-browse is localized for English by default. To modify the default English localization or add localization for other languages, see the following sections on this page:
- Localizing the Customer Co-browse and Chat Widget UIs
- Localizing the "Live Chat" and "Co-browsing" buttons
- Localizing the Agent UI
- Caching and updating l10n files
- Built-in localization
Localizing the Customer Co-browse and Chat Widget UIs
To localize the Customer Co-browse and Chat Widget UIs, configure the localization option in the chat and cobrowse subsections of the global configuration variable. By default, _genesys is the global configuration variable. To configure the localization option, do one of the following:
- Pass localization data to the configuration object in you website instrumentation. You can provide localization directly as a JS object or provide localization using a function.
-
The localization files are plain JSON files, loaded through a JSONP request. This means they can be hosted on any domain as long as JSONP is supported by the hosting server. Co-browse uses a standard callback argument for the callback function name. See Serving JSONP for information on how to serve JSONP using Co-browse servers.
Provide Localization Directly as a JS Object
The simplest way to provide localization is to use a plain JavaScript object of key value pairs.
Example:
<script>
_genesys = {
chat: {
localization: {
chatTitle: "The cozy chat"
}
}
};
</script>
Provide Localization Using a Function
If a JavaScript object is not sufficient, you can use a function to provide localization. For example, you can use a function to figure out localization at runtime.
Example:
<script>
_genesys = {
cobrowse: {
localization: function() {
if (window.currentLanguage = 'ru') {
return { toolbarContent: "Ключ сессии: {sessionId}" }
}
}
}
};
</script>
Asynchronous Function
Your function can also be asynchronous and you can use an asynchronous function to load localization how you prefer. To tell the configuration variable that your function is asynchronous, create your function with an argument. Customarily, the argument is done. We will pass a function that you have to call whenever the localization loads.
Example:
<script>
_genesys = {
cobrowse: {
localization: function(done) {
jQuery.get('my/cobrowse/localization.json', done);
}
}
};
</script>
Provide Localization Using an External JSON File
If you pass a string to the localization configuration option, the string will be treated as a URL to an external JSON file.
Example:
<script>
_genesys = {
cobrowse: {
localization: '//example.com/cobrowse-l10n/2014-10-08/cobrowse-fr.json'
},
chat: {
localization: '//another-example.com/chat-l10n/2014-10-08/chat-fr.json'
}
};
</script>
If the files can not be loaded, initialization of our functionality will be blocked.
Localizing the "Live Chat" and "Co-browsing" buttons
The "Live Chat" and "Co-browsing" default buttons are images and localization changes will not affect the text on these buttons. Instead, you can localize the buttons using one of the following methods:
- Provide custom localized buttons instead of the defaults. See Integrated JavaScript Application#Providing Custom HTML for Buttons for details.
- Override how the buttons look using CSS. See Customizing the CSS for details.
Localizing the Agent UI
The Agent UI is localized by updating the localization configuration option to the URL of the JSON localization file in the slave section of the Co-browse Server application. Unlike the customer UI, the value is changed in the Genesys Configuration server and not via the instrumentation script. The agent UI cannot be configured by passing a JavaScript object or function.
Caching and updating Localization (l10n) files
Requests to the l10n files are made on every page that is instrumented with Co-browse, before the Co-browse UI is displayed. Genesys recommends that you implement a caching mechanism for these files if you host them on your servers.
For best performance, add far-future expiration headers (for example, Expires, Cache-Control or both) to your l10n files. This prevents the browser from requesting these files on each page. Instead, it will take them from the cache. This reduces the start-up time for the Co-browse UI and cuts down traffic for the end user. If you modify a localization file with a far-future expiration header, the browser must request the new version of the file from the server instead of taking it from the cache. To force the browser to do this you must change the URL of the file. You can do this by updating the corresponding localization parameter in Co-browse instrumentation after either putting the modified file in a new directory or updating the file's name.
For example, consider the case where you have set up your own server to host the Co-browse localization files for the customer UI:
<script>
var _genesys = {
cobrowse: {
localization: '//example.com/cobrowse-l10n/2014-09-07/cobrowse-fr.json'
}
};
</script>
<COBROWSE_INSTRUMENTATION_SCRIPT>
Next, you modify some of your localization files and want them to be refreshed for all users, so you create a new directory and update your Co-browse instrumentation:
<script>
var _genesys = {
cobrowse: {
localization: '//example.com/cobrowse-l10n/2014-10-08/cobrowse-fr.json'
}
};
</script>
<COBROWSE_INSTRUMENTATION_SCRIPT>
Now, any browsers that had cached the files will be reload the files and re-cache them.
Built-in localization
This section lists the default localization values and keys.
You can use the code snippets in this section to create your own localization files. To do so, copy and save the code snippet as a .json file.
Customer UI
{
"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.",
"sessionsOverLimit": "Representative is currently busy with another Co-browse session. 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>",
"chatIsAlreadyRunning": "Chat is already running on another page.",
"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."
}
Chat Widget
See Localization in the Chat Widget JS API.
Agent
{
"invalidSessionID": "Session ID is invalid or has expired.",
"navRefresh": "Refresh is pressed. Reloading page.",
"navBack": "Back is pressed. Reloading page.",
"navForward": "Forward is pressed. Reloading page.",
"youLeft": "You have left the session. Co-browse is now terminated.",
"customerLeft": "Customer has left the session. Co-browse is now terminated.",
"exitBtnText": "Exit Session",
"sessionIdText": "Session ID: {sessionId}",
"enterSessionIdText": "Session ID:",
"modeWrite": "Mode: Write",
"modePointer": "Mode: Pointer",
"downgradeToPointer": "Downgrade to pointer mode",
"navigationDenied": "Navigation request has failed.",
"maskedNodeTitle": "This content is visible only to customer",
"unsupportedNodeTitle": "Some data is missing due to Co-browse limitations",
"navigationRestricted": "Navigation is restricted in Pointer mode.",
"modeUpgraded": "Switched to Write mode. Now you can interact with the page.",
"modeDowngraded": "Switched to Pointer mode. Customer can only see your cursor and clicks.",
"writeModeRequested": "Requested Write mode. Waiting for customer approval.",
"modeUpgradeDenied": "Customer declined upgrading to Write mode."
}