Skip to content
+

Data Grid - Translated components

The Data Grid allows to support users from different locales, with formatting, and localized strings.

The default locale of MUI X is English (United States). If you want to use other locales, follow the instructions below.

Translation keys

You can use the localeText prop to pass in your own text and translations. You can find all the translation keys supported in the source in the GitHub repository. In the following example, the labels of the density selector are customized.

Press Enter to start editing

Locale text

The default locale of MUI X is English (United States).

You can use the theme to configure the locale text:

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { DataGrid } from '@mui/x-data-grid';
import { bgBG } from '@mui/x-data-grid/locales';
// Or import { bgBG } from '@mui/x-data-grid-pro/locales';
// Or import { bgBG } from '@mui/x-data-grid-premium/locales';

const theme = createTheme(
  {
    palette: {
      primary: { main: '#1976d2' },
    },
  },
  bgBG,
);

<ThemeProvider theme={theme}>
  <DataGrid />
</ThemeProvider>;

Note that createTheme accepts any number of arguments. If you are already using the translations of the core components, you can add bgBG as a new argument. The same import works for Data Grid Pro as it's an extension of Data Grid.

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { DataGrid } from '@mui/x-data-grid';
import { bgBG } from '@mui/x-data-grid/locales';
import { bgBG as pickersBgBG } from '@mui/x-date-pickers/locales';
import { bgBG as coreBgBG } from '@mui/material/locale';

const theme = createTheme(
  {
    palette: {
      primary: { main: '#1976d2' },
    },
  },
  bgBG, // x-data-grid translations
  pickersBgBG, // x-date-pickers translations
  coreBgBG, // core translations
);

<ThemeProvider theme={theme}>
  <DataGrid />
</ThemeProvider>;

If you want to pass language translations directly to the Data Grid without using createTheme and ThemeProvider, you can directly load the language translations from @mui/x-data-grid/locales.

import { DataGrid } from '@mui/x-data-grid';
import { nlNL } from '@mui/x-data-grid/locales';

<DataGrid localeText={nlNL.components.MuiDataGrid.defaultProps.localeText} />;

Supported locales

LocaleBCP 47 language tagImport nameCompletionSource file
Arabic (Sudan)ar-SDarSD
114/123
Edit
Belarusianbe-BYbeBY
88/123
Edit
Bulgarianbg-BGbgBG
122/123
Edit
Chinese (Hong Kong)zh-HKzhHK
114/123
Edit
Chinese (Simplified)zh-CNzhCN
Done 🎉
Edit
Chinese (Taiwan)zh-TWzhTW
114/123
Edit
Croatianhr-HRhrHR
122/123
Edit
Czechcs-CZcsCZ
118/123
Edit
Danishda-DKdaDK
122/123
Edit
Dutchnl-NLnlNL
118/123
Edit
Finnishfi-FIfiFI
118/123
Edit
Frenchfr-FRfrFR
122/123
Edit
Germande-DEdeDE
Done 🎉
Edit
Greekel-GRelGR
114/123
Edit
Hebrewhe-ILheIL
118/123
Edit
Hungarianhu-HUhuHU
116/123
Edit
Icelandicis-ISisIS
114/123
Edit
Italianit-ITitIT
122/123
Edit
Japaneseja-JPjaJP
122/123
Edit
Koreanko-KRkoKR
87/123
Edit
Norwegian (Bokmål)nb-NOnbNO
118/123
Edit
Norwegian (Nynorsk)nn-NOnnNO
118/123
Edit
Persianfa-IRfaIR
118/123
Edit
Polishpl-PLplPL
87/123
Edit
Portuguesept-PTptPT
Done 🎉
Edit
Portuguese (Brazil)pt-BRptBR
Done 🎉
Edit
Romanianro-ROroRO
114/123
Edit
Russianru-RUruRU
118/123
Edit
Slovaksk-SKskSK
117/123
Edit
Spanishes-ESesES
Done 🎉
Edit
Swedishsv-SEsvSE
122/123
Edit
Turkishtr-TRtrTR
120/123
Edit
Ukrainianuk-UAukUA
114/123
Edit
Urdu (Pakistan)ur-PKurPK
114/123
Edit
Vietnamesevi-VNviVN
122/123
Edit

You can find the source in the GitHub repository.

To create your own translation or to customize the English text, copy this file to your project, make any changes needed and import the locale from there. Note that these translations of the Data Grid component depend on the Localization strategy of the whole library.

RTL Support

Right-to-left languages such as Arabic, Persian, or Hebrew are supported. Follow this guide to use them.

The example below demonstrates how to use an RTL language (Arabic) with the Data Grid.

Press Enter to start editing