Jump to: navigation, search

Localization

Customer Defined Strings

You can define string key names and values to match the system messages that are received from the chat server. If a customer system message is received as SYS001 in the message body, Webchat checks to determine if any keys match in the language pack, and then replaces the message body accordingly. SYS001 is an example format. There are no format restrictions on custom message keys. The purpose of this feature is to allow localization for the User Interface and Server to be kept in the same 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.

Error Handling

Customers can define their own error messages by defining them in the Errors section found in the above Webchat Localization. If no error messages are defined, default error messages are used.

Important
For information on how to setup localization, please refer to the Localization Guide

Usage

'webchat' namespace should be used when defining localization strings for WebChat plugin in your i18n JSON file.

In the example below, we demonstrate defining new strings for the 'en' (English) language. You may use any language codes you wish; there is no standard format. When selecting the active language in your configuration, you must match one of the language codes defined in your i18n JSON file. Please note that you must only define a language code once in your i18n JSON file. Inside each language object you should define new strings for each widget.

Default i18n JSON

{
	"en": {
		"webchat": {
			"ChatButton": "Chat",
			"ChatStarted": "Chat Started",
			"ChatEnded": "Chat Ended",
			"AgentNameDefault": "Agent",
			"AgentConnected": "<%Agent%> Connected",
			"AgentDisconnected": "<%Agent%> Disconnected",
			"SupervisorNameDefault": "Supervisor",
			"SupervisorConnected": "<%Agent%> Connected",
			"SupervisorDisconnected": "<%Agent%> Disconnected",
			"AgentTyping": "...",
			"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": "Required",
			"ChatFormPlaceholderLastName": "Required",
			"ChatFormPlaceholderNickname": "Optional",
			"ChatFormPlaceholderEmail": "Optional",
			"ChatFormPlaceholderSubject": "Optional",
			"ChatFormSubmit": "Start Chat",
			"ChatFormCancel": "Cancel",
			"ChatFormClose": "Close",
			"ChatInputPlaceholder": "Type your message here",
			"ChatInputSend": "SEND",
			"ChatEndQuestion": "Are you sure you want to end this chat session?",
			"ChatEndCancel": "Cancel",
			"ChatEndConfirm": "End chat",
			"ConfirmCloseWindow": "Are you sure you want to close chat?",
			"ConfirmCloseCancel": "Cancel",
			"ConfirmCloseConfirm": "Close",
			"ActionsDownload": "Download transcript",
			"ActionsEmail": "Email transcript",
			"ActionsPrint": "Print transcript",
			"ActionsCobrowseStart": "Start Co-browse",
			"ActionsSendFile": "Send File",
			"ActionsCobrowseStop": "Exit Co-browse",
			"ActionsVideo": "Invite to Video Chat",
			"ActionsTransfer": "Transfer",
			"ActionsInvite": "Invite",
			"InstructionsTransfer": "Open this link on another device to transfer your chat session</br></br><%link%>",
			"InstructionsInvite": "ShowSurveyAcceptare this link with another person to add them to this chat session</br></br><%link%>",
			"InviteTitle": "Need help?",
			"InviteBody": "Let us know if we can help out.",
			"InviteReject": "No thanks",
			"InviteAccept": "Start chat",
			"ChatError": "There was a problem starting the chat session. Please Retry.",
			"ChatErrorButton": "OK",
			"DownloadButton": "Download",
			"FileSent": "has sent:",
			"FileTransferRetry": "Retry",
			"FileTransferError": "OK",
			"FileTransferCancel": "Cancel",
			"RestoreTimeoutTitle": "Chat ended",
			"RestoreTimeoutBody": "Your previous chat session has timed out. Would you like to start a new one?",
			"RestoreTimeoutReject": "No thanks",
			"RestoreTimeoutAccept": "Start chat",
			"EndConfirmBody": "Would you really like to end your chat session?",
			"EndConfirmAccept": "End chat",
			"EndConfirmReject": "Cancel",
			"SurveyOfferQuestion": "Would you like to participate in a survey?",
			"ShowSurveyAccept": "Yes",
			"ShowSurveyReject": "No",
			"UnreadMessagesTitle": "unread",
			"AriaYouSaid": "You said",
			"AriaSaid": "said",
			"AriaSystemSaid": "System said",
			"AriaMinimize": "Live Chat minimize",
			"AriaMaximize": "Live Chat Maximize",
			"AriaClose": "Live chat close",
			"Errors": {
				"102": "First name is required",
				"103": "Last name is required",
				"161": "Please enter your name",
				"201": "The file could not be sent.<br/><strong><p class='filename' title='<%FilenameFull%>'>'<%FilenameTruncated%>'</p></strong><p class='advice'>The maximum number of attached files would be exceeded (<%MaxFilesAllowed%>)</p>",
				"202": "The file could not be sent.<br/><strong><p class='filename' title='<%FilenameFull%>'>'<%FilenameTruncated%>'</p></strong><p class='advice'>Upload limit and/or maximum number of attachments would be exceeded (<%MaxAttachmentsSize%>)</p>",
				"203": "The file could not be sent.<br/><strong><p class='filename' title='<%FilenameFull%>'>'<%FilenameTruncated%>'</p></strong><p class='advice'>File type is not allowed.</p>",
				"204": "We're sorry but your message is too long. Please write a shorter message",
				"240": "We're sorry but we cannot start a new chat at this time. Please try again later",
				"364": "Invalid email address",
				"ChatUnavailable": "We're sorry but we cannot start a new chat at this time. Please try again later",
				"CriticalFault": "Your chat session has ended unexpectedly due to an unknown issue. We apologize for the inconvenience",
				"StartFailed": "There was an issue starting your chat session. Please verify your connection and that you submitted all required information properly, then try again",
				"MessageFailed": "Your message was not received successfully. Please try again",
				"RestoreFailed": "We're sorry but we were unable to restore your chat session due to an unknown error",
				"TransferFailed": "Unable to transfer chat at this time. Please try again later",
				"FileTransferSizeError": "The file could not be sent.<br/><strong><p class='filename' title='<%FilenameFull%>'>'<%FilenameTruncated%>'</p></strong><p class='advice'>File size is larger than the allowed size (<%MaxSizePerFile%>)</p>",
				"InviteFailed": "Unable to generate invite at this time. Please try again later",
				"ChatServerWentOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
				"RestoredOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
				"Disconnected": "<div style='text-align:center'>Connection lost</div>",
				"Reconnected": "<div style='text-align:center'>Connection restored</div>",
				"FileSendFailed": "The file could not be sent.<br/><strong><p class='filename' title='<%FilenameFull%>'><%FilenameTruncated%></p></strong><p class='advice'>There was an unexpected disconnection. Try again?</p>",
				"Generic": "<div style='text-align:center'>An unexpected error occurred</div>"
			}
		}
	}
}

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on 3 January 2018, at 08:47.