-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add locale support to number-text column (#1499)
# Pull Request ## 🤨 Rationale This is part of #1011 This PR adds support for the number-text column using the `lang` token on the theme provider to format numbers in a locale-aware way. ## 👩💻 Implementation I followed the same pattern used in the date-text column to listen for changes to the `lang` theme provider token and pass that into the formatters for the number-text column. ## 🧪 Testing - Manually tested in storybook - New unit test for the column that verifies the formatter is updated with the `lang` changes - New unit tests for each formatter that verify the locale is used when formatting - Note: I updated the formatter tests to run all the test cases with an additional locale. On one hand this potentially seemed like "too many" locale tests, but I thought it was the best way to ensure that the locale was used in all internal formatters (e.g. the `default` formatter uses 3 formatters internally) and that we had coverage for a wide range of possible values to be formatted. ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [ ] I have updated the project documentation to reflect my changes or determined no changes are needed.
- Loading branch information
1 parent
d791161
commit b49755b
Showing
10 changed files
with
448 additions
and
206 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@ni-nimble-components-ac937d1b-bb11-4937-90be-1d29c446ca0b.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "Add locale support to number-text column", | ||
"packageName": "@ni/nimble-components", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.