-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Adding localization to Material-UI #1692
Conversation
Is working on Datepicker ('en' and 'es' locales)
What do you think about #1658? |
Using momentjs is a good idea.. but i dont like the way of passing locale for each component.. i guess is better to set the locale in the root component's context. Unless you want to set different locale for each component.. but i dont think so :) Let me know if i can collaborate with other people.. maybe incorporate my approach into someone else's. |
I agree with you. Having the locale in the context sounds like a good idea. For me, the drawback of using momentjs or your approach vs the standardized Intl, is the size of the output you send to the user. |
Agree. Maybe i could try using react-intl instead of hardcoding locales (seems that this library already manages dates and other strings). Want me to give it a try? |
@nahue I'm not really sure about adding a dependency to this project. What do you think about adding a locale and a IntlDateFormater in the context? So that, I can rebase my #1658 PR to use it instead of passing property all the way down to the components that need it? |
Would be nice! im working on a project and i really need i18n on mui components.. @oliviertassinari let me know if you need help! |
@oliviertassinari , |
Any progress on this matter? |
* [core] Align internal icons with mono-repository * rebase * fix typo
I used react-translate-component and counterpart modules to enable this. If you take a look at master.jsx (from docs module). There are a few simple steps to enable it:
if you change setLocale to 'es'.. the datepicker will be in spanish (used that for testing)
locales are available in /src/locales/es.js and en.js (file structure needs work)
Let me know if this works for you!
Material-UI is awesome thanks for the hard work!