microsoft / microsoft/BotFramework-WebChat
Uploaded file in Polish appears to be empty
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 1.8k
- Forks
- 1.6k
- Avg merge
- 22h 58m
- Merged PRs (30d)
- 2
Description
Is it an issue related to Adaptive Cards?
- Yes, this is an Adaptive Card issue but it is specific to Web Chat.
Do you have any screenshots?
No response
What version of Web Chat are you using?
I am not using latest
Which distribution are you using Web Chat from?
Bundle (webchat.js)
Which hosting environment does this issue primarily affect?
Web apps
Which browsers and platforms do the issue happened?
Browser: Edge (latest), Browser: Chrome (latest), Browser: Firefox (latest), Browser: Safari (latest), Browser: IE Mode (latest), Platform: Windows, Platform: macOS, Platform: iOS/iPadOS, Platform: Android
Which area does this issue affect?
Attachment: Other rich cards
Is this an accessibility issue?
- Yes, this is an accessibility issue.
Please describe the bug
This issue repro as early as 4.8.0 (2020 March), and did not repro on 4.7.1 (2019 December).
The technical root cause is:
- One of our packages downloaded the official Unicode CLDR database
- The CLDR database we are using is v36 at https://github.com/unicode-cldr/cldr-units-full/blob/36.0.0/main/pl/units.json, it has inconsistent data
- There is a newer revision of v36 at https://raw.githubusercontent.com/unicode-org/cldr/release-36/common/main/pl.xml which has consistent data. However, we are not using this revision
- The CLDR database it downloaded is inconsistent and causing an exception:
- The database has two parts to support internationalizing a file size: plural generator and unit formatter, we only use bytes, kilobytes, megabytes, and gigabytes
- The plural generator turns a number into a plural type
- In English, it turn 1 -> "one" and any other numbers -> "other" (only 2 types)
- In Polish, the plural type for number could be "one", "many", "few", and "other" (4 types in total)
- The unit formatter localize a number into string based on the plural type
- In English, "one" -> "$1 byte", "other" -> "$1 bytes"
- In Polish, "one" -> "$1 bajt", etc.
- The inconsistency:
- Plural generator return "one", "many", "few", "other" for Polish
- Unit formatter only support "other"
- This is causing the unit formatter throwing exception when the number has plural type of "one", "many", or "few"
When the Unicode CLDR is downloaded from https://github.com/unicode-cldr/cldr-units-full/archive/36.0.0.zip, it does not contains one/few/many for short/digital-gigabyte, short/digital-megabyte, and short/digital-kilobyte.
However, the supplemental/plurals say Polish do have plural types of one/few/many, as shown below:

When we are doing our investigation, we also look at another source of Unicode CLDR, at https://github.com/unicode-org/cldr/blob/release-36/common/main/pl.xml. In this source, we do see short/digital-gigabyte et al. have one/few/many.
We concluded the issue is rooted from the Unicode CLDR v36 database. And it is causing globalize package to fail due to the missing strings.
Do you see any errors in console log?
Based on 4.14.1.


How to reproduce the issue?
- Use Polish and talk to MockBot
- Upload a file
What is the expected and actual behavior?
Expected: the uploaded file should display properly
Actual: the uploaded file appear to be an empty box
Adaptive Card JSON
No response
Additional context
IcM ticket 332820283 and 330190903.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the attachment upload in Polish with the Web Chat bundle and inspect the console exception reported for version 4.14.1. Compare the downloaded Unicode CLDR v36 data with the newer CLDR revision and the globalize package's plural and unit-formatting inputs; done means the uploaded file renders properly instead of appearing as an empty box.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, localization
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100