问题描述
我正在寻找如何根据用户说的语言在网络聊天中动态设置语言代码。
我尝试过
window.WebChat.renderWebChat({
directLine: window.WebChat.createDirectLine({
secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}),styleOptions: {
hideUploadButton: true,botAvatarInitials: 'Bot'
},selectVoice: (voices,activity) => voices.find(({
name
}) => /Kalpana/iu.test(name)),//Console.log(activity.locale);
webSpeechPonyfillFactory: window.WebChat.createCognitiveServicesspeechServicesPonyfillFactory({
region: 'xxxx',subscriptionKey: 'xxxxx'
}),userID: "ravi@gmail.com",locale: 'hi-IN'
},document.getElementById('webchat')
);
document.querySelector('#webchat > *').focus();
我要寻找的是,我需要根据用户说的语言动态设置 locale 参数。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)