Revision as of 19:27, January 21, 2016 by Bfriend (talk | contribs) (Language Pack File Format)
Jump to: navigation, search

Localization

Genesys Widgets allow for localizing 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 are set in the window_genesys.cxwidget.main section.

<script>
	if (!window._genesys)
		window._genesys = {};

	window._genesys.cxwidget = {
		main: {
			theme: "dark",
			lang: "en",
			i18n: "http://HOST:PORT/path/to/lanaguages/file.json"
		}
	};
</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

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.

Language Pack File Format

The Language Pack File 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.",
			"ChatFailedRetry": "Retry",
			"ChatFailedClose": "Close",
			"UserNameDefault": "Anonymous",
			"AgentNameDefault": "Agent",
			"AgentConnected": "<%Agent%> Connected",
			"AgentDisconnected": "<%Agent%> Disconnected",
			"AgentTyping": "...",
			"AgentPending": "An Agent will be with you shortly",
			"AgentUnavailable": "Sorry. There are no agents available. Please try later",
			"ChatTitle": "Live Chat",
			"ChatEnd": "X",
			"ChatClose": "X",
			"ChatMinimize": "Min",
			"ChatFormFirstName": "First Name",
			"ChatFormLastName": "Last Name",
			"ChatFormNickname": "Nickname",
			"ChatFormEmail": "Email",
			"ChatFormSubject": "Subject",
			"ChatFormPlaceholderFirstName": "Optional",
			"ChatFormPlaceholderLastName": "Optional",
			"ChatFormPlaceholderNickname": "Optional",
			"ChatFormPlaceholderEmail": "Optional",
			"ChatFormPlaceholderSubject": "Optional",
			"ChatFormSubmit": "Start Chat",
			"ChatFormCancel": "Cancel",
			"ChatInputPlaceholder": "Type your message here and hit return",
			"ChatInputSend": "SEND",
			"ChatEndQuestion": "Are you sure you want to end this chat session?",
			"ChatEndCancel": "Cancel",
			"ChatEndConfirm": "End chat",
			"ActionsDownload": "Download transcript",
			"ActionsEmail": "Email transcript",
			"ActionsPrint": "Print transcript",
			"ActionsCobrowseStart": "Start Co-browse",
			"ActionsCobrowseStop": "Exit Co-browse",
			"ActionsVideo": "Invite to Video Chat",
			"InviteTitle": "Need help?",
			"InviteBody": "Let us know if we can help out.",
			"InviteReject": "No thanks",
			"InviteAccept": "Start chat",
			"EndConfirmBody": "Would you really like to end your chat session?",
			"EndConfirmAccept": "End chat",
			"EndConfirmReject": "Cancel",

			// Customer Defined Strings - Match & Replace messages received from chat server
			"SYS0001": "An Agent will be with you shortly"
		}
	}
}

Language Codes

To allow flexibility in the way 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. Whatever language code you set in window._genesys.cxwidget.main.lang must correlate to a language code in the Language Pack File.

Special Values for Localization

You can inject the <%Agent%> special value. When used, the agent's name is rendered in its place at runtime.

Comments or questions about this documentation? Contact us for support!