Skip to content
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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

bharatkashyap
Copy link
Member

@bharatkashyap bharatkashyap commented Jan 20, 2025

Breaking Change

@bharatkashyap bharatkashyap added new feature New feature or request l10n localization labels Jan 20, 2025
@mui-bot
Copy link

mui-bot commented Jan 20, 2025

Netlify deploy preview

https://deploy-preview-4620--mui-toolpad-docs.netlify.app/

Generated by 🚫 dangerJS against a7fd3a5

@@ -1,5 +1,5 @@
import * as React from 'react';
import { AuthenticationContext, SessionContext } from '@toolpad/core/AppProvider';
import { AppProvider } from '@toolpad/core/AppProvider';
Copy link
Member Author

@bharatkashyap bharatkashyap Jan 23, 2025

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> = {
Copy link
Member Author

@bharatkashyap bharatkashyap Jan 23, 2025

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

@bharatkashyap bharatkashyap requested a review from Janpot January 23, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l10n localization new feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable localization injection from outside for all texts
2 participants