Jump to: navigation, search
(Update with the copy of version: draft)
(Update with the copy of version: draft)
Line 12: Line 12:
 
{{NoteFormat|For information on how to setup localization, please refer to the  [[GWCInternat|Localization Guide]]|1}}
 
{{NoteFormat|For information on how to setup localization, please refer to the  [[GWCInternat|Localization Guide]]|1}}
  
==Strings==
+
==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.
 +
 
 +
==Example i18n JSON==
 
<source lang='javascript'>{
 
<source lang='javascript'>{
"ChatButton": "Chat",
+
"en": {
"ChatStarted": "Chat Started",
+
"webchat": {
"ChatEnded": "Chat Ended",
+
"ChatButton": "Chat",
"AgentNameDefault": "Agent",
+
"ChatStarted": "Chat Started",
"AgentConnected": "<%Agent%> Connected",
+
"ChatEnded": "Chat Ended",
"AgentDisconnected": "<%Agent%> Disconnected",
+
"AgentNameDefault": "Agent",
"SupervisorNameDefault": "Supervisor",
+
"AgentConnected": "<%Agent%> Connected",
"SupervisorConnected": "<%Agent%> Connected",
+
"AgentDisconnected": "<%Agent%> Disconnected",
"SupervisorDisconnected": "<%Agent%> Disconnected",
+
"SupervisorNameDefault": "Supervisor",
"AgentTyping": "...",
+
"SupervisorConnected": "<%Agent%> Connected",
"AgentUnavailable": "Sorry. There are no agents available. Please try later",
+
"SupervisorDisconnected": "<%Agent%> Disconnected",
"ChatTitle": "Live Chat",
+
"AgentTyping": "...",
"ChatEnd": "X",
+
"AgentUnavailable": "Sorry. There are no agents available. Please try later",
"ChatClose": "X",
+
"ChatTitle": "Live Chat",
"ChatMinimize": "Min",
+
"ChatEnd": "X",
"ChatFormFirstName": "First Name",
+
"ChatClose": "X",
"ChatFormLastName": "Last Name",
+
"ChatMinimize": "Min",
"ChatFormNickname": "Nickname",
+
"ChatFormFirstName": "First Name",
"ChatFormEmail": "Email",
+
"ChatFormLastName": "Last Name",
"ChatFormSubject": "Subject",
+
"ChatFormNickname": "Nickname",
"ChatFormPlaceholderFirstName": "Required",
+
"ChatFormEmail": "Email",
"ChatFormPlaceholderLastName": "Required",
+
"ChatFormSubject": "Subject",
"ChatFormPlaceholderNickname": "Optional",
+
"ChatFormPlaceholderFirstName": "Required",
"ChatFormPlaceholderEmail": "Optional",
+
"ChatFormPlaceholderLastName": "Required",
"ChatFormPlaceholderSubject": "Optional",
+
"ChatFormPlaceholderNickname": "Optional",
"ChatFormSubmit": "Start Chat",
+
"ChatFormPlaceholderEmail": "Optional",
"ChatFormCancel": "Cancel",
+
"ChatFormPlaceholderSubject": "Optional",
"ChatFormClose": "Close",
+
"ChatFormSubmit": "Start Chat",
"ChatInputPlaceholder": "Type your message here",
+
"ChatFormCancel": "Cancel",
"ChatInputSend": "SEND",
+
"ChatFormClose": "Close",
"ChatEndQuestion": "Are you sure you want to end this chat session?",
+
"ChatInputPlaceholder": "Type your message here",
"ChatEndCancel": "Cancel",
+
"ChatInputSend": "SEND",
"ChatEndConfirm": "End chat",
+
"ChatEndQuestion": "Are you sure you want to end this chat session?",
"ConfirmCloseWindow": "Are you sure you want to close chat?",
+
"ChatEndCancel": "Cancel",
"ConfirmCloseCancel": "Cancel",
+
"ChatEndConfirm": "End chat",
"ConfirmCloseConfirm": "Close",
+
"ConfirmCloseWindow": "Are you sure you want to close chat?",
"ActionsDownload": "Download transcript",
+
"ConfirmCloseCancel": "Cancel",
"ActionsEmail": "Email transcript",
+
"ConfirmCloseConfirm": "Close",
"ActionsPrint": "Print transcript",
+
"ActionsDownload": "Download transcript",
"ActionsCobrowseStart": "Start Co-browse",
+
"ActionsEmail": "Email transcript",
"ActionsSendFile": "Send File",
+
"ActionsPrint": "Print transcript",
"ActionsCobrowseStop": "Exit Co-browse",
+
"ActionsCobrowseStart": "Start Co-browse",
"ActionsVideo": "Invite to Video Chat",
+
"ActionsSendFile": "Send File",
"ActionsTransfer": "Transfer",
+
"ActionsCobrowseStop": "Exit Co-browse",
"ActionsInvite": "Invite",
+
"ActionsVideo": "Invite to Video Chat",
"InstructionsTransfer": "Open this link on another device to transfer your chat session</br></br><%link%>",
+
"ActionsTransfer": "Transfer",
"InstructionsInvite": "ShowSurveyAcceptare this link with another person to add them to this chat session</br></br><%link%>",
+
"ActionsInvite": "Invite",
"InviteTitle": "Need help?",
+
"InstructionsTransfer": "Open this link on another device to transfer your chat session</br></br><%link%>",
"InviteBody": "Let us know if we can help out.",
+
"InstructionsInvite": "ShowSurveyAcceptare this link with another person to add them to this chat session</br></br><%link%>",
"InviteReject": "No thanks",
+
"InviteTitle": "Need help?",
"InviteAccept": "Start chat",
+
"InviteBody": "Let us know if we can help out.",
"ChatError": "There was a problem starting the chat session. Please Retry.",
+
"InviteReject": "No thanks",
"ChatErrorButton": "OK",
+
"InviteAccept": "Start chat",
"DownloadButton": "Download",
+
"ChatError": "There was a problem starting the chat session. Please Retry.",
"FileSent": "has sent:",
+
"ChatErrorButton": "OK",
"FileTransferRetry": "Retry",
+
"DownloadButton": "Download",
"FileTransferError": "OK",
+
"FileSent": "has sent:",
"FileTransferCancel": "Cancel",
+
"FileTransferRetry": "Retry",
"RestoreTimeoutTitle": "Chat ended",
+
"FileTransferError": "OK",
"RestoreTimeoutBody": "Your previous chat session has timed out. Would you like to start a new one?",
+
"FileTransferCancel": "Cancel",
"RestoreTimeoutReject": "No thanks",
+
"RestoreTimeoutTitle": "Chat ended",
"RestoreTimeoutAccept": "Start chat",
+
"RestoreTimeoutBody": "Your previous chat session has timed out. Would you like to start a new one?",
"EndConfirmBody": "Would you really like to end your chat session?",
+
"RestoreTimeoutReject": "No thanks",
"EndConfirmAccept": "End chat",
+
"RestoreTimeoutAccept": "Start chat",
"EndConfirmReject": "Cancel",
+
"EndConfirmBody": "Would you really like to end your chat session?",
"SurveyOfferQuestion": "Would you like to participate in a survey?",
+
"EndConfirmAccept": "End chat",
"ShowSurveyAccept": "Yes",
+
"EndConfirmReject": "Cancel",
"ShowSurveyReject": "No",
+
"SurveyOfferQuestion": "Would you like to participate in a survey?",
"UnreadMessagesTitle": "unread",
+
"ShowSurveyAccept": "Yes",
"AriaYouSaid": "You said",
+
"ShowSurveyReject": "No",
"AriaSaid": "said",
+
"UnreadMessagesTitle": "unread",
"AriaSystemSaid": "System said",
+
"AriaYouSaid": "You said",
"AriaMinimize": "Live Chat minimize",
+
"AriaSaid": "said",
"AriaMaximize": "Live Chat Maximize",
+
"AriaSystemSaid": "System said",
"AriaClose": "Live chat close",
+
"AriaMinimize": "Live Chat minimize",
"Errors": {
+
"AriaMaximize": "Live Chat Maximize",
"102": "First name is required",
+
"AriaClose": "Live chat close",
"103": "Last name is required",
+
"Errors": {
"161": "Please enter your name",
+
"102": "First name is required",
"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>",
+
"103": "Last name is required",
"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>",
+
"161": "Please enter your name",
"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>",
+
"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>",
"204": "We're sorry but your message is too long. Please write a shorter message",
+
"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>",
"240": "We're sorry but we cannot start a new chat at this time. Please try again later",
+
"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>",
"364": "Invalid email address",
+
"204": "We're sorry but your message is too long. Please write a shorter message",
"ChatUnavailable": "We're sorry but we cannot start a new chat at this time. Please try again later",
+
"240": "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",
+
"364": "Invalid email address",
"StartFailed": "There was an issue starting your chat session. Please verify your connection and that you submitted all required information properly, then try again",
+
"ChatUnavailable": "We're sorry but we cannot start a new chat at this time. Please try again later",
"MessageFailed": "Your message was not received successfully. Please try again",
+
"CriticalFault": "Your chat session has ended unexpectedly due to an unknown issue. We apologize for the inconvenience",
"RestoreFailed": "We're sorry but we were unable to restore your chat session due to an unknown error",
+
"StartFailed": "There was an issue starting your chat session. Please verify your connection and that you submitted all required information properly, then try again",
"TransferFailed": "Unable to transfer chat at this time. Please try again later",
+
"MessageFailed": "Your message was not received successfully. Please try again",
"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>",
+
"RestoreFailed": "We're sorry but we were unable to restore your chat session due to an unknown error",
"InviteFailed": "Unable to generate invite at this time. Please try again later",
+
"TransferFailed": "Unable to transfer chat at this time. Please try again later",
"ChatServerWentOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
+
"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>",
"RestoredOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
+
"InviteFailed": "Unable to generate invite at this time. Please try again later",
"Disconnected": "<div style='text-align:center'>Connection lost</div>",
+
"ChatServerWentOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
"Reconnected": "<div style='text-align:center'>Connection restored</div>",
+
"RestoredOffline": "Messages are currently taking longer than normal to get through. We're sorry for the delay",
"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>",
+
"Disconnected": "<div style='text-align:center'>Connection lost</div>",
"Generic": "<div style='text-align:center'>An unexpected error occurred</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>"
 +
}
 +
}
 
}
 
}
 
}</source>
 
}</source>
  
 
[[Category:V:PSAAS:Public]]
 
[[Category:V:PSAAS:Public]]

Revision as of 17:19, November 15, 2017

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.

Example 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>"
			}
		}
	}
}
Comments or questions about this documentation? Contact us for support!