-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix types for translateWithId() methods. (#17055)
* fix: translateWithId() parameter types Add proper types for parameter to translateWithId() methods. Each component's translateWithId() method can only take a certain list of keys, not any string. Update the Typescript to notate this. For historical reasons most of the existing translation keys are declared in a convoluted way. For example: export const translationIds = { 'increment.number': 'increment.number', 'decrement.number': 'decrement.number', }; type TranslationKey = keyof typeof translationIds; The simpler way is just: type TranslationKey = 'increment.number' | 'decrement.number’; I didn’t update that in this PR, but it’s something to consider for the future. Note that TableToolbarSearch.tsx and MultiSelect.tsx don’t suffer from this problem. Refs #12513. * chore: extend InternationalProps instead of declaring translateWithId() Refs #12513. * chore: rename InternationalProps --------- Co-authored-by: Taylor Jones <[email protected]>
- Loading branch information
1 parent
50e88bc
commit df0e941
Showing
16 changed files
with
147 additions
and
141 deletions.
There are no files selected for viewing
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
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.