Skip to content
+

Event Timeline - Localization

Translate UI labels and date formats to support a global audience.

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

Translation keys

Use the localeText prop to pass in your own text and translations. You can find all supported translation keys in the source on GitHub. The demo below customizes the resource column header and loading text.

Locale text

Use the theme to configure the locale text:

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';
import { frFR } from '@mui/x-scheduler/locales';
// Or import { frFR } from '@mui/x-scheduler-premium/locales';

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

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

The createTheme() function accepts any number of arguments. If you're already using the translations of the core components, you can add frFR as a new argument.

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';
import { frFR } from '@mui/x-scheduler/locales';
import { frFR as pickersFrFR } from '@mui/x-date-pickers/locales';
import { frFR as coreFrFR } from '@mui/material/locale';

const theme = createTheme(
  {
    palette: {
      primary: { main: '#1976d2' },
    },
  },
  frFR, // x-scheduler translations
  pickersFrFR, // x-date-pickers translations
  coreFrFR, // core translations
);

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

To pass language translations directly to the Event Timeline without using createTheme() and ThemeProvider, load them from @mui/x-scheduler/locales.

import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';
import { frFR } from '@mui/x-scheduler/locales';

<EventTimelinePremium
  localeText={frFR.components.MuiEventTimeline.defaultProps.localeText}
/>;

Date locale

The localeText prop only translates the UI labels (button text, menu items, etc.). To also translate formatted dates (day names, month names, and week start day), pass a date-fns locale object.

Use the createDateLocaleTheme helper to set the date locale globally via the theme, alongside localeText translations:

import { createTheme, ThemeProvider } from '@mui/material/styles';
import { fr } from 'date-fns/locale/fr';
import { frFR, createDateLocaleTheme } from '@mui/x-scheduler/locales';
import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';

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

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

You can also pass the dateLocale prop directly to the component to override the theme value or avoid using a theme:

import { fr } from 'date-fns/locale/fr';
import { EventTimelinePremium } from '@mui/x-scheduler-premium/event-timeline-premium';

<EventTimelinePremium dateLocale={fr} />;
LocaleBCP 47 language tagImport nameCompletionSource file
Arabic (Sudan)ar-SDarSD
0/100
Edit
Armenianhy-AMhyAM
0/100
Edit
Banglabn-BDbnBD
0/100
Edit
Belarusianbe-BYbeBY
0/100
Edit
Bulgarianbg-BGbgBG
0/100
Edit
Catalanca-EScaES
0/100
Edit
Chinese (Hong Kong)zh-HKzhHK
0/100
Edit
Chinese (Simplified)zh-CNzhCN
0/100
Edit
Chinese (Taiwan)zh-TWzhTW
0/100
Edit
Croatianhr-HRhrHR
0/100
Edit
Czechcs-CZcsCZ
0/100
Edit
Danishda-DKdaDK
0/100
Edit
Dutchnl-NLnlNL
0/100
Edit
Finnishfi-FIfiFI
0/100
Edit
Frenchfr-FRfrFR
88/100
Edit
Germande-DEdeDE
88/100
Edit
Greekel-GRelGR
0/100
Edit
Hebrewhe-ILheIL
0/100
Edit
Hungarianhu-HUhuHU
0/100
Edit
Icelandicis-ISisIS
0/100
Edit
Indonesianid-IDidID
0/100
Edit
Italianit-ITitIT
88/100
Edit
Japaneseja-JPjaJP
0/100
Edit
Koreanko-KRkoKR
0/100
Edit
Norwegian (Bokmål)nb-NOnbNO
88/100
Edit
Norwegian (Nynorsk)nn-NOnnNO
0/100
Edit
Persianfa-IRfaIR
0/100
Edit
Polishpl-PLplPL
95/100
Edit
Portuguesept-PTptPT
88/100
Edit
Portuguese (Brazil)pt-BRptBR
88/100
Edit
Romanianro-ROroRO
88/100
Edit
Russianru-RUruRU
0/100
Edit
Slovaksk-SKskSK
0/100
Edit
Spanishes-ESesES
89/100
Edit
Swedishsv-SEsvSE
0/100
Edit
Thaith-THthTH
0/100
Edit
Turkishtr-TRtrTR
0/100
Edit
Ukrainianuk-UAukUA
0/100
Edit
Urdu (Pakistan)ur-PKurPK
0/100
Edit
Vietnamesevi-VNviVN
0/100
Edit

To create your own translation or customize the English text, copy this file to your project, make any needed changes, and import the locale from there. These translations follow the Localization strategy of the whole library.

API

See the documentation below for a complete reference to all of the props and classes available to the components mentioned here.