-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Implement i18n #196
Comments
I recall a discussion around a year ago about what would be the best approach to handle localization with large components, e.g mui/material-ui-pickers#1429 (comment). While we use |
My first comment is about exposing an API to allow customizing the wordings in the data grid. There is a second important dimension to consider: providing out of the box support for popular locales. We could use the exact same mechanism as the other components. The content could be stored in the main repository. We aim to support the 100 most used locales. The main downside would be about the bloat introduced, but I would argue it's negligible. If we decided to host the translations in the repository, we will need to work on the bundling script as it's not set up to support it. |
A proposed plan of action, we do it in two steps. The first step closes this issue, a new issue will need to be open for 2. (so we can have a number of 👍 that isn't skewed by an issue linked in the documentation). 1. i18n
2. l10n
import { createMuiTheme, ThemeProvider } from '@material-ui/core/styles';
import { zhCN } from '@material-ui/date-grid/locale'; // for DataGrid
import { zhCN } from '@material-ui/x-grid/locale'; // for XGrid
import { zhCN } from '@material-ui/x/locale'; // for all the X components
const theme = createMuiTheme(
{
palette: {
primary: { main: '#1976d2' },
},
},
zhCN,
);
<ThemeProvider theme={theme}>
<App />
</ThemeProvider>; |
Benchmark
The text was updated successfully, but these errors were encountered: