Jump to: navigation, search

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 Master Co-browse and Chat Widget UIs

To localize the master 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:

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>
Warning
Functions you pass will be called after our scripts initialize, shortly after the document ready event. If you use an asynchronous function, initialization will be postponed until you call the done function.

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>
Important
Our scripts will attempt to load localization files using JSONP. You can use Co-browse server to serve files as JSONP for you. See Serving JSONP.

If the files can not be loaded, initialization of our functionality will be blocked.


You must save localization JSON files with UTF-8 encoding.

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:

  1. Provide custom localized buttons instead of the defaults. See Integrated JavaScript Application#Providing Custom HTML for Buttons for details.
  2. Override how the buttons look using CSS. See Customizing the CSS for details.

Localizing the Slave UI

The slave 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 master UI, the value is changed in the Genesys Configuration server and not via the instrumentation script. The slave UI can not be configured by passing a JavaScript object or function.

Important
The localization file is loaded using JSONP. You can use Co-browse server to serve files as JSONP for you or configure your own infrastructure for JSONP support. See Serving JSONP.

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 master 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.

Important
You must save your localization JSON files using UTF-8 encoding.
Tip
It is not necessary to list all the keys in your localization JSON file. In your JSON file, you can specify only the keys you wish to override. Any key not specified will use the default localization value.

Master 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 occurred. 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."
}
Important
The modalTitle and serverUnavailable keys were added to Genesys Co-browse in release 8.5.001.xx.

Chat Widget

See Localization in the Chat Widget JS API.

Slave

{
  "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."
}
This page was last modified on February 15, 2019, at 09:41.

Feedback

Comment on this article:

blog comments powered by Disqus