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

Enable localization injection from outside for all texts #4565

Open
fredicious opened this issue Dec 28, 2024 · 1 comment
Open

Enable localization injection from outside for all texts #4565

fredicious opened this issue Dec 28, 2024 · 1 comment
Labels
enhancement This is not a bug, nor a new feature good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@fredicious
Copy link

fredicious commented Dec 28, 2024

Summary

It would be nice to avoid hard-coded English texts, and allow localization.

Examples

example of hard-coded English text: https://github.com/mui/toolpad/blob/master/packages/toolpad-core/src/SignInPage/SignInPage.tsx#L349

Motivation

I am building a dashboard in another language.

Search keywords: localize, translate, lang

@fredicious fredicious added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 28, 2024
@bharatkashyap bharatkashyap added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Dec 30, 2024
@bharatkashyap
Copy link
Member

bharatkashyap commented Dec 30, 2024

Agreed. A LocaleContext already exists internally and is consumed by the Account and related components: https://mui.com/toolpad/core/react-account/#labels

We can extend the LocaleContextType to include every label across components, and add an optional defaultLocaleText prop on the AppProvider and consume the LocaleContext inside the AppProvider instead of Account.

@bharatkashyap bharatkashyap added the good first issue Great for first contributions. Enable to learn the contribution process. label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is not a bug, nor a new feature good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

No branches or pull requests

2 participants