T368442 will add a new composable that returns an i18n function. This task covers updating components to use the new composable for relevant string props so those strings could be translated.
There are 2 types of string props we'll be updating:
- Those that cover strings that could feasibly need to be customized by the dev user. For these strings, the prop should not be removed, so users can still provide a custom string.
- Those that never need to be customizable, such a specific a11y text that describes functionality and is feature-agnostic. These props can be removed altogether.
The following props are affected:
Component | Prop | Allow customization? | Notes |
---|---|---|---|
ChipInput, InputChip | chipAriaDescription | No | Remove |
Dialog | closeButtonLabel | Yes | Add boolean useCloseButton prop, eventually set closeButtonLabel default to English fallback |
Field, Label | optionalFlag | No | Add boolean optional prop, eventually set optionalFlag default to English fallback |
Message | dismissButtonLabel | Yes | Add allowUserDismiss prop, eventually set dismissButtonLabel default to English fallback |
SearchInput | buttonLabel | Yes | Add boolean useButton prop, eventually set buttonLabel default to English fallback |
Table | selectAllLabel | No | Remove |
Table | selectRowLabel | No | Remove |
Table | sortCaption | No | Remove |
Table | Others related to pagination | TBD | TBD |
TypeaheadSearch | searchResultsLabel | No | Remove |
TypeaheadSearch | buttonLabel | Yes | Add useButton prop, eventually set buttonLabel default to English fallback |
Acceptance criteria
- All of the above components are updated to use the new composable and change props as necessary
- The old API still works (i.e. this is not a breaking change)
- Future breaking changes are noted inline in component code referencing T368444