Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
161 views
in Technique[技术] by (71.8m points)

botframework - Skype response language parameter

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'}]

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...