-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
[l10n] Allow importing the direct locale file #10920
Comments
Would it work with only? import { frFR } from '@mui/x-date-pickers/locale-frFR'; Supporting 3rd levels import comes with a downside. Today, we set the expectation that all 2nd level imports are allowed and all 3rd levels are not. Introduction an exception to the rule could make it hard for developers to know when which one is OK. Related to mui/material-ui#31096. |
It would, but what about localization-related DX? Just confirming, that @flaviendelangle was specifically suggesting to introduce such importing exception only for locales, with a plan of possibly removing the |
Localization files are a perfect candidate for importing directly (2 levels deep in our case).
The majority of date libraries suggest doing it like this as well, i.e.:
import 'dayjs/locale/fr';
import 'moment/locale/fr;
In our case, the following is not possible:
import { frFR } from '@mui/x-date-pickers/locales/frFR';
.Allowing the deeper import would:
Related issues: #10918, #10919, mui/material-ui#39525.
Search keywords:
The text was updated successfully, but these errors were encountered: