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 set up 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.

Inactivity Messages

If Chat Server is configured to end the chat session after a certain idle time, it may send several warning messages to the client to inform them and prompt them to act. Chat Server can be configured to show a first warning, a second warning, and a final notice when it ends the chat session. By default, WebChat will display the warning message text as it is received from the server. If you wish to localize these methods on the client side instead, follow these steps:

The first warning can be localized by setting the string 'IdleMessage1'.

The second warning can be localized by setting the string 'IdleMessage2'.

The final notice can be localized by setting the string 'IdleMessageClose'.

Tip
Find more information on configuring Inactivity Monitoring for Chat Server here.
Tip
If Chat Server ever allows more than two idle warning messages, you can localize them by incrementing the integer value in the string name (e.g. 'IdleMessage3', 'IdleMessage4', and so on).

Default i18n JSON

{
	"en": {
		"webchat": {
			"ChatButton": "Chat",
			"ChatStarted": "Chat Started",
			"ChatEnded": "Chat Ended",
			"AgentNameDefault": "Agent",
			"AgentConnected": "<%Agent%> Connected",
			"AgentDisconnected": "<%Agent%> Disconnected",
			"BotNameDefault": "Bot",
			"BotConnected": "<%Bot%> Connected",
			"BotDisconnected": "<%Bot%> Disconnected",
			"SupervisorNameDefault": "Supervisor",
			"SupervisorConnected": "<%Agent%> Connected",
			"SupervisorDisconnected": "<%Agent%> Disconnected",
			"AgentTyping": "...",
			"AriaAgentTyping": "Agent is typing",
			"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",
			"AriaChatFormSubmit": "Start Chat",
			"ChatFormCancel": "Cancel",
			"AriaChatFormCancel": "Cancel",
			"ChatFormClose": "Close",
			"ChatInputPlaceholder": "Type your message here",
			"ChatInputSend": "Send",
			"AriaChatInputSend": "Send",
			"ChatEndQuestion": "Are you sure you want to end this chat session?",
			"ChatEndCancel": "Cancel",
			"ChatEndConfirm": "End chat",
			"AriaChatEndCancel": "Cancel",
			"AriaChatEndConfirm": "End chat",
			"ConfirmCloseWindow": "Are you sure you want to close chat?",
			"ConfirmCloseCancel": "Cancel",
			"ConfirmCloseConfirm": "Close",
			"AriaConfirmCloseCancel": "Cancel",
			"AriaConfirmCloseConfirm": "Close",
			"ActionsDownload": "Download transcript",
			"ActionsEmail": "Email transcript",
			"ActionsPrint": "Print transcript",
			"ActionsCobrowseStart": "Start Co-browse",
			"AriaActionsCobrowseStartTitle": "Opens the Co-browse session",
			"ActionsSendFile": "Attach Files",
			"AriaActionsSendFileTitle": "Opens a file upload dialog",
			"ActionsEmoji": "Send Emoji",
			"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": "Share 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",
			"AriaInviteAccept": "Start chat",
			"AriaInviteReject": "No thanks",
			"ChatError": "There was a problem starting the chat session. Please retry.",
			"ChatErrorButton": "OK",
			"AriaChatErrorButton": "OK",
			"ChatErrorPrimaryButton": "Yes",
			"ChatErrorDefaultButton": "No",
			"AriaChatErrorPrimaryButton": "Yes",
			"AriaChatErrorDefaultButton": "No",
			"DownloadButton": "Download",
			"AriaDownloadButton": "Download",
			"FileSent": "has sent:",
			"FileTransferRetry": "Retry",
			"AriaFileTransferRetry": "Retry",
			"FileTransferError": "OK",
			"AriaFileTransferError": "OK",
			"FileTransferCancel": "Cancel",
			"AriaFileTransferCancel": "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",
			"AriaRestoreTimeoutAccept": "Start chat",
			"AriaRestoreTimeoutReject": "No thanks",
			"EndConfirmBody": "Would you really like to end your chat session?",
			"EndConfirmAccept": "End chat",
			"EndConfirmReject": "Cancel",
			"AriaEndConfirmAccept": "End chat",
			"AriaEndConfirmReject": "Cancel",
			"SurveyOfferQuestion": "Would you like to participate in a survey?",
			"ShowSurveyAccept": "Yes",
			"ShowSurveyReject": "No",
			"AriaShowSurveyAccept": "Yes",
			"AriaShowSurveyReject": "No",
			"UnreadMessagesTitle": "unread",
			"AriaYouSaid": "You said",
			"AriaSaid": "said",
			"AriaSystemSaid": "System said",
			"AriaWindowLabel": "Live Chat Window",
			"AriaMinimize": "Live Chat Minimize",
			"AriaMaximize": "Live Chat Maximize",
			"AriaClose": "Live Chat Close",
			"AriaEmojiStatusOpen": "Emoji picker dialog is opened",
			"AriaEmojiStatusClose": "Emoji picker dialog is closed",
			"AriaEmoji": "emoji",
			"AriaCharRemaining": "Characters remaining",
			"AriaMessageInput": "Message box",
			"AsyncChatEnd": "End Chat",
			"AsyncChatClose": "Close Window",
			"AriaAsyncChatEnd": "End Chat",
			"AriaAsyncChatClose": "Close Window",
			"DayLabels": [
				"Sun",
				"Mon",
				"Tue",
				"Wed",
				"Thur",
				"Fri",
				"Sat"
			],
			"MonthLabels": [
				"Jan",
				"Feb",
				"Mar",
				"Apr",
				"May",
				"Jun",
				"Jul",
				"Aug",
				"Sept",
				"Oct",
				"Nov",
				"Dec"
			],
			"todayLabel": "Today",
			"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='cx-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='cx-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='cx-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.",
				"401": "We're sorry but we are not able to authorize the chat session. Would you like to start a new chat?",
				"404": "We're sorry but we cannot find your previous chat session. Would you like to start a new chat?",
				"500": "We're sorry, an unexpected error occurred with the service. Would you like to close and start a new Chat?",
				"503": "We're sorry, the service is currently unavailable or busy. Would you like to close and start a new Chat again?",
				"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='cx-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='cx-advice'>There was an unexpected disconnection. Try again?</p>",
				"Generic": "<div style='text-align:center'>An unexpected error occurred.</div>",
				"pureengage-v3-rest-INVALID_FILE_TYPE": "Invalid file type. Only Images are allowed.",
				"pureengage-v3-rest-LIMIT_FILE_SIZE": "File size is larger than the allowed size.",
				"pureengage-v3-rest-LIMIT_FILE_COUNT": "The maximum number of attached files exceeded the limit.",
				"pureengage-v3-rest-INVALID_CONTACT_CENTER": "Invalid x-api-key transport configuration.",
				"pureengage-v3-rest-INVALID_ENDPOINT": "Invalid endpoint transport configuration.",
				"pureengage-v3-rest-INVALID_NICKNAME": "First Name is required.",
				"pureengage-v3-rest-AUTHENTICATION_REQUIRED": "We're sorry but we are not able to authorize the chat session.",
				"purecloud-v2-sockets-400": "Sorry, something went wrong. Please verify your connection and that you submitted all required information properly, then try again.",
				"purecloud-v2-sockets-500": "We're are sorry, an unexpected error occurred with the service.",
				"purecloud-v2-sockets-503": "We're sorry, the service is currently unavailable."
			}
		}
	}
}
This page was last edited on April 23, 2021, at 18:33.
Comments or questions about this documentation? Contact us for support!