Jump to: navigation, search

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.widgets.main section.

Example:

<script>
 
    if(!window._genesys)window._genesys = {};
    if(!window._gt)window._gt = [];
 
    window._genesys.widgets = {
 
        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",
                        ...
                    },
 
                    "sendmessage": {
 
			"EmailFormFirstname": "First Name",
			"EmailFormLastname": "Last Name",
                         ...
                     }
                }
            }
        }
    };
</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.Can be partial or complete. Unspecified strings will use default values.

main.i18n (inline object)
Type: object
Default: built-in English words and phrases
Requirement: Optional
Description: An inline JSON object. 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"
        },
 
        "sendmessage": {
 
              // Localized strings
	     "SendMessageButton": "Send Message",
	     "EmailFormFirstname": "First Name",
	     "EmailFormLastname": "Last Name",
 
             //Errors
             "ErrorServerNotAvailable": "Unable to reach server. Please try again.",
	     "ErrorAttachfileSizeMax": "Total size of attachments exceeds limit: "
    }
}

Localization Namespaces

Plugin Namespace
WebChat webchat
SendMessage sendmessage
CallUs callus
ChannelSelector channelselector
CallBack callback
KnowledgeCenter knowledgecenter
Offers offers
Calendar calendar

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.widgets.main.lang must correlate to a language code in the Language Pack File.

Plugin Localization Options

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on October 1, 2018, at 04:46.