Revision as of 13:49, November 22, 2013 by Jumunn (talk | contribs) (Created new topic from branched topic Documentation:GCB:Developer:Localization:8.1.3)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Localization

Genesys Co-browse is localized for English by default, and it is split into three parts: master UI, built-in chat UI, and slave UI. To modify the default English localization or add localizations for other languages, you must host the localization files on their own servers and configure the Co-browse application to use these files instead of the defaults.

You can do so using one of the following methods:

  • Configure the Co-browse solution to override the default URLs (preferred).
  • Override the paths to the default Co-browse l10n files using a reverse proxy, such as Nginx.

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.

The sections below describe how to configure the Co-browse Server to override the default URLs.

Localizing the master and chat UI

The URLs for loading the l10n files for the master UI and the built-in chat UI are constructed by overriding properties of the global _gcb variable. See Customize the Genesys Co-browse User Interface for details about using this variable.

The _gcb properties you can override are:

  1. localesURI - Path to the l10n files. By default, this path is constructed as <COBROWSE_APPLICATION_URL>/nls/.
  2. localesPrefix - Prefix for the master UI l10n JSON file. The default value is cobrowseMaster-.
  3. localesPrefixChat - Prefix for built-in chat UI l10n JSON file. The default value is cobrowseMasterChat-.
  4. locale - Current locale. The default value is en.

The URL for the master UI localization is constructed as localesURI + localesPrefix + locale + '.json'.

Caching and updating 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 cache these files if you host them on your servers.

Add far-future expiration headers (for example, Expires, Cache-Control or both) to your 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 also saves some 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, put the modified file in a new directory and update the localesURI

For example, you have set up your own server to host the Co-browse localization files:

<script>
var _gcb = {
    localesURI: '//example.com/cobrowse-l10n/2013-08-02/',
    locale: 'en'
};
</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 _gcb = {
    localesURI: '//example.com/cobrowse-l10n/2013-09-05/',
    locale: 'en'
};
</script>
<COBROWSE_INSTRUMENTATION_SCRIPT>

Now the files will be reloaded by any browsers that had cached them, and then re-cached.

Localizing the "Live Chat" and "Co-browsing" buttons

The "Live Chat" and "Co-browsing" default buttons are images, which means changes to the localization will not effect 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 Providing custom buttons for details.
  2. Override the way the buttons look using CSS. See Customizing the CSS for details.

Localizing the slave UI

The slave UI is localized by updating the values of configuration options in the slave section of the Co-browse Server application:

  1. localesURI - Path to the l10n files.
  2. localesPrefix - Prefix for the master UI l10n JSON file.
  3. locale - Current locale.
Comments or questions about this documentation? Contact us for support!