firefox-devtools / firefox-devtools/profiler
Format numbers and dates depending on the language determined by fluent
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 491
- Avg merge
- 3d 46m
- Merged PRs (30d)
- 27
Description
Currently we have some places that we format the dates and numbers, like:
https://github.com/firefox-devtools/profiler/blob/50124adbfa488adba6e2674a8f2618cf34b59cd2/src/components/app/ListOfPublishedProfiles.js#L37-L59
or
https://github.com/firefox-devtools/profiler/blob/50124adbfa488adba6e2674a8f2618cf34b59cd2/src/utils/format-numbers.js#L30-L34
(this list is not extensive)
These are determined by the default language of the browser right now because of the `undefined` in the first argument. But if we don't have the locale for user's language, we default to English. In this case, user sees a UI with English texts but also with their locale's date and number formatting. They should be consistent instead to make sure that users can understand the formatting easily.
There are also another case where we format the numbers that come from Firefox with user's locale. They should be always formatted with English to make the data that comes from Firefox consistent (since we don't localize the Firefox's data currently).
┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-416)
Contributor guide
Assessment
This issue has not been assessed yet.