Jump to: navigation, search
(Update with the copy of version: draft)
(Update with the copy of version: draft)
Line 1: Line 1:
 
= Localization=
 
= 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.
+
{{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/Developer/GWCInternat.}}
 
 
Example:
 
 
 
<source lang="javascript">
 
<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>
 
</source>
 
 
 
{{AnchorDiv|mtlp}}
 
==Multiple Translated Language Packs==
 
 
 
Multiple i18n language pack files are available as individual JSON files in the /i18n folder. You can select the desired language pack file and then set the <tt>i18n</tt> and <tt>lang</tt> properties in the '''window._genesys.widgets.main''' configuration option. Each language pack file is named using the language code to identify easily. The same language code is also used inside the language pack file to construct the i18n JSON. This language code must be specified in the '''main.lang''' configuration option.
 
 
 
Example:
 
 
 
The French language pack file is available as '''widgets-fr.i18n.json'''. To use this language pack file, follow the example below.
 
 
 
<source lang="javascript">
 
 
 
window._genesys.widgets = {
 
 
 
    main: {
 
 
 
        lang: "fr",
 
        i18n: "/relative/path/to/i18n/widgets-fr.i18n.json"
 
 
 
        // OR using the CDN URL
 
        i18n: "https://apps.mypurecloud.com/widgets/<version>/i18n/widgets-fr.i18n.json"
 
    }
 
};
 
 
 
</source>
 
 
 
 
 
'''Language code mapping'''
 
 
 
{| class="wikitable"
 
|-
 
! Language !! Code
 
|-
 
| German || de
 
|-
 
| French || fr
 
|}
 
 
 
==Configuration Options==
 
'''main.lang'''<br>
 
'''Type''': string<br>
 
'''Default''': "en"<br>
 
'''Requirement''': Optional<br>
 
'''Description''': A language code to specify which language to display in the Widgets. Language codes are set by the customer.
 
 
 
'''main.i18n (external file)'''<br>
 
'''Type''': string<br>
 
'''Default''': built-in English words and phrases<br>
 
'''Requirement''': Optional<br>
 
'''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)'''<br>
 
'''Type''': object<br>
 
'''Default''': built-in English words and phrases<br>
 
'''Requirement''': Optional<br>
 
'''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.
 
 
 
<source lang="javascript">
 
 
 
// 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: "
 
    }
 
}
 
</source>
 
 
 
==Localization Namespaces==
 
{| style="width: auto;"
 
|-
 
! 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.
 
 
 
{{NoteFormat|When using one of the available pre-translated language packs, ensure the language code maps with the one included in the language pack file.}}
 
 
 
==Plugin Localization Options==
 
 
 
*[[GCBCobrowseLocalization|Co-browse Localization]]
 
*[[SendMessageLocalization|SendMessage Localization]]
 
*[[SendMessageServiceLocalization|SendMessageService Localization]]
 
*[[WebChatLocalization|WebChat Localization]]
 
*[[WebChatServiceLocalization|WebChatService Localization]]
 
<!--*[[GWELocalization|GWE Localization]]-->
 
  
 
[[Category:V:PSAAS:Public]]
 
[[Category:V:PSAAS:Public]]

Revision as of 21:52, October 17, 2019

Localization

Important
Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/Developer/GWCInternat.
Comments or questions about this documentation? Contact us for support!