microsoft / BotFramework-WebChat

A highly-customizable web-based client for Azure Bot Services.
https://www.botframework.com/
MIT License
1.59k stars 1.54k forks source link

useLocalizeDate failed because the language is not in CLDR #3039

Open compulim opened 4 years ago

compulim commented 4 years ago

Screenshots

image

(It is okay to pass "en" to language. But not okay to pass "en-US".)

Version

4.8.0

Describe the bug

In useLocalizeDate.js, we are passing a language identifier of "en-US", but getLocaleString.js is expecting "en" instead (the one specified in CLDR).

If the language identifier is not found in the CLDR database, then, the dateFormatter() function will return undefined.

Steps to reproduce

  1. Run the hook useLocalizeDate

Expected behavior

It should return the date in localized format.

Instead, it throw an exception:

image

Additional context

Related to https://github.com/microsoft/BotFramework-Emulator/issues/2119.

[Bug]

tonyanziano commented 4 years ago

Nice find!

corinagum commented 3 years ago

needs prioritization