网页客服组件语言
企业可以很方便的设置网页客服组件的语言,除了在系统中设置的网页客服组件外,企业还可以通过本API来实现更多自定义的语言配置,您可以为不同的客服组件设置不同的语言,或为网页客服组件设置个性化的语言翻译内容。
具体请阅读下面文档内容进行语言自定义开发。
registerLang 注册自定义语言包
.registerLang(name, langMap) 注册一个自定义的语言包,也可以局部修改一个指定的内置语言包。
@param String name 语言包名称,如果是注册新语言包,建议您的语言包名称不要和内置语言包('en' ,'zh_CN')重名,否则将会覆盖重名的内置语言包。
@param Object langMap 语言映射图谱。语言图谱的全部项目请见附件1。如果是自定义的新语言包,需要翻译完所有项目。
示例:
window.KF5SupportBoxAPI.ready(function()
{
// 注册自定义的新语言包:'en_my'
window.KF5SupportBoxAPI.registerLang('en_my', {
'email': 'Email',
'mobile': 'Mobile',
… // 全部项目见附件1
});
// 局部修改内置的 'en' 语言包
window.KF5SupportBoxAPI.registerLang('en', {
'email': 'Your Email',
'mobile': 'Your Mobile'
});
});useLang 使用指定语言包
.useLang(name) 设置使用指定的语言包。可以使用的内置语言包名称有:'en' ,'zh_CN'。
@param String name 语言包名称,可以为您自己注册的语言包的名称,也可以为内置语言包名称。
示例:
window.KF5SupportBoxAPI.ready(function()
{
// 使用自定义的 'en_my' 语言包
window.KF5SupportBoxAPI.useLang('en_my');
// 使用内置的 'en' 英文语言包
// window.KF5SupportBoxAPI.useLang('en');
});附录: 网页客服组件语言对应
完整的语言包图谱:
{
'email': 'Email',
'mobile': 'Phone',
'mobileNo': 'Phone',
'telephoneNo': 'Landline',
'qqNo': 'QQ',
'emptyContent': 'No content',
'toLivechat': 'Chat with us',
'toLeaveMessage': 'Leave a message',
'typing': 'Typing...',
'soundOpenTitle': 'Turn on notification',
'soundCloseTitle': 'Turn off notification',
'newWindowOpenTitle': 'Open in new window',
'loadMore': 'Load more',
'toLeaveMessageOnQueueUp': function (linkTagBegin, linkTagEnd) {
return 'Your are in the queue, or ' + linkTagBegin + 'leave a message' + linkTagEnd + 'with us' },
'toLeaveMessageOnNoAgents': function (linkTagBegin, linkTagEnd) {
return 'No agents online, or ' + linkTagBegin + 'leave a message' + linkTagEnd + 'with us' },
'nicknameOrName': 'Name',
'submitInfo': 'Submit',
'cancel': 'Cancel',
'selectConsultType': 'Please select type',
'sendFile': 'Send file',
'emoji': 'Emoji',
'remoteAssistance': 'Remote assistance',
'robot': 'Chat with robot',
'transferToAgent': 'Chat with agent',
'send': 'Send',
'leaveMessageToUs': 'Leave a message',
'optional': 'Optional',
'select': '-Please select-',
'leaveMessage': 'Leave a message',
'livechat': 'Chat with an agent',
'prompt': 'Notice',
'back': 'Back',
'question': 'Your question',
'startChat': 'Start chat',
'enterYourQuestion': 'Please enter your question',
'documentPreview': 'Article preview',
'documentDetail': 'View full article',
'leaveMessageSuccess': 'Your message submitted successfully!',
'chatting': 'Chating',
'joinSession': 'joined the chat',
'leaveSession': 'left the chat',
'uploadFailed': 'upload failed',
'nicknameEmptyError': 'Name cannot be blank',
'emailFormatError': 'Incorrect email format',
'mobileFormatError': 'Incorrect phone number format',
'serviceCommentTitle': 'It is an honor to serve your, please rate our service',
'satisfy': 'Satisfy',
'unsatisfy': 'Unsatisfy',
'messageEmptyError': 'Message cannot be blank!',
'messageMaxSizeError': 'Message length cannot exceed 1000!',
'forHelp': 'Help',
'noAgents': 'No agents are currently online',
'qqChatFailed': 'No agents allcated or no QQ configured',
'enterHere': 'Enter message here',
'canIHelpU': 'How can I help you',
'searchResult': 'Search result' }总结
企业可以根据自己的场景灵活使用和配置语言文字和切换语言。
