-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Add LocalizationProvider
#4620
base: master
Are you sure you want to change the base?
Conversation
Netlify deploy preview |
@@ -1,5 +1,5 @@ | |||
import * as React from 'react'; | |||
import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider'; | |||
import { AppProvider } from '@toolpad/core/AppProvider'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change on all demos is since none of the demos on this page were using the Account
component inside the AppProvider
- added that since I think that is expected use, and also allows demonstrating overriding global localization using the localeText
prop.
Kept one example which still demonstrates using Account
without AppProvider
but the constituent context providers instead
} | ||
|
||
const defaultAccountLocaleText: Pick<LocaleText, keyof AccountLocaleText> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using component-level defaults as a worst-case default for standalone usage of the component without any context being provided, similar to Material UI practice
Breaking Change
Rename some existing localization keys on the
Account
component to make them part of the globalLocaleText
signInLabel
->accountSignInLabel
signOutLabel
->accountSignOutLabel
iconButtonAriaLabel
->accountPreviewIconButtonLabel
Closes Enable localization injection from outside for all texts #4565