Skip to content

Keep props.locale when sending to bot#3095

Merged
compulim merged 6 commits intomicrosoft:masterfrom
compulim:fix-3074
Apr 10, 2020
Merged

Keep props.locale when sending to bot#3095
compulim merged 6 commits intomicrosoft:masterfrom
compulim:fix-3074

Conversation

@compulim
Copy link
Copy Markdown
Contributor

@compulim compulim commented Apr 9, 2020

Fixes #3074.

Changelog Entry

Fixed

Description

If the dev set props.locale to en-HK, we should send this to the bot without modifications.

Today, since en-HK is not in the localization database, we normalize it to en and send it to the bot. We should only use the normalized form when we need it, e.g. date/unit formatting.

Normalizing means, we change it from an unknown string, into something closest in our database with our best effort.

Specific Changes

  • Modify Composer not to normalize the locale for useLanguage and Web Chat Core
  • Modify Composer to do the normalization for:
    • Localized strings
    • Date/unit formatter (a.k.a. globalize)

  • Testing Added

@compulim compulim marked this pull request as ready for review April 9, 2020 20:30
Comment thread docs/HOOKS.md Outdated
@compulim compulim merged commit 9c38967 into microsoft:master Apr 10, 2020
@compulim compulim deleted the fix-3074 branch April 10, 2020 03:42
compulim added a commit that referenced this pull request Apr 10, 2020
* Keep props.locale when sending to bot

* Add entry

* Clean up

* Update docs/HOOKS.md

Co-Authored-By: Corina <[email protected]>

* Fix tests

Co-authored-by: Corina <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants