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 · 3 comments
Open

Enable localization injection from outside for all texts #4565

fredicious opened this issue Dec 28, 2024 · 3 comments
Labels
enhancement This is not a bug, nor a new feature good first issue Great for first contributions. Enable to learn the contribution process. scope: toolpad-core Abbreviated to "core"

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
@Janpot
Copy link
Member

Janpot commented Jan 6, 2025

We can model it after the X implementation. See https://mui.com/x/react-date-pickers/localization/

@fredicious Which languages did you have in mind and are you open to contribute translations for them?

@gil-obradors
Copy link
Contributor

As it is a first case, if no one else starts working on it, I would take care of it myself, but in two weeks' time.
@Janpot Regardless of who starts the work, once done I can contribute with Spanish and Catalan.

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. scope: toolpad-core Abbreviated to "core"
Projects
Status: No status
Development

No branches or pull requests

5 participants