Skype response language parameter

偶尔善良 提交于 2019-12-13 08:07:35

问题


While sending request to bot through web Skype, it is sending locale as 'en-US'. How I can change it to any other language? How Skype decide automatically to send it to 'en-US'?

'entities': [{'locale': 'en-US', 'country': 'US', 'platform': 'Web', 'type': 'clientInfo'}]


回答1:


Possible answer

I don't have access to the Bot Connector sources so it will be difficult to ensure that my answer is valid, but I think your language value comes from one of the following properties:

  • Language of your Skype profile
  • Language of the installed Skype app you are using
  • Language of the operating system where you use Skype

Why I am assuming it is one of those values?

You can have a look how it is made on other channels, in particular if you have a look to the open-source Webchat channel, you will see the following here :

locale: props.locale || (window.navigator as any)["userLanguage"] || window.navigator.language || 'en'

So in the Webchat, it is using (in order of priority):

  • the locale set in webchat properties (coming from the queryString for example)
  • the "userLanguage" of the navigator if any
  • the navigator language if any
  • en as default value


来源:https://stackoverflow.com/questions/50481060/skype-response-language-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!