问题
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