question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Specific Locale passed into webchat is not being sent to Bot service. (HealthBot)

See original GitHub issue

Screenshots

Version

https://cdn.botframework.com/botframework-webchat/latest/webchat-es5.gzip.js

To determine what version of Web Chat you are running, open your browser’s development tools, and paste the following line of code into the console.

[].map.call(document.head.querySelectorAll('meta[name^="botframework-"]'), function (meta) { return meta.outerHTML; }).join('\n')

If you are using Web Chat outside of a browser, please specify your hosting environment. For example, React Native on iOS, Cordova on Android, SharePoint, PowerApps, etc.

Describe the bug

Looks as though if I pass in a locale “es-US”, it will send “es-ES” to the HealthBot service when posting activities. It seems the chatbot js only supports es-ES as a locale for it’s strings and then therefore sending on this locale to the service. It’d be ideal that the locale passed in to the chatbot can translate to es-ES for the chatbot strings however respect the intention and forward on the locale that was passed in.

passing-in-locale locale-sent-botsvc

Steps to reproduce

  1. Pass in locale “es-US” to store.dispatch({ type: ‘DIRECT_LINE/POST_ACTIVITY’, meta: { method: ‘keyboard’ }, payload: { activity: { type: “invoke”, name: “InitConversation”, locale: “es-US” …
  2. Bot text is based on “es-ES” locale.

Expected behavior

Would like to see that the culture passed in is respected to forward on to botsvc.

Additional context

This was found using the HealthBot service as we created localization files for “es-US”.

[Bug]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
compulimcommented, Apr 9, 2020

We have this fallback logic in-place already in normalizeLanguage.js.

But we do this fallback too early, so the bot is not receiving he-IL, but only he. I have a PR up, so we are passing the locale as-is to the bot, even it is an invalid locale.

1reaction
beyacklecommented, Apr 9, 2020

I think the standard way to do a fallback is to just drop the country code entirely. If we don’t support es-US, then the next language we should look for is just es, not necessarily es-ES. If it can’t find es without a country code, then that’s a problem - I don’t know if there’s a policy about this, but I’d expect every language to have a sensible default when the country code is unspecified. Similarly, he-IL isn’t in the list, but the fallback should find he, which is.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect a bot to Web Chat - Microsoft Learn
Learn how to use the Web Chat control to connect to a bot that uses the Web Chat channel.
Read more >
How can I send some initial data to the bot before the user ...
I'm using "https://github.com/microsoft/BotFramework-WebChat" this web chat as my client side, it create the directline using the secret, is ...
Read more >
Adding scenarios to an Azure Health Bot (Episode 2) - YouTube
Learn Azure Health Bot : Adding scenarios to an Azure Health Bot (Episode 2)Join the chat and ask questions live at ...
Read more >
Manage localization across a Virtual Assistant solution
This site is obsolete and should be used for reference only. The information in this documentation is not guaranteed to work for Bot...
Read more >
Microsoft/BotBuilder - Gitter
Also, I'd advise using the webchat channel not the directline channel. ... 1) you can force the locale by passing locale={'en-US'} ( in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found