Skip to content

Localization

Every string the table shows (buttons, tooltips, menu items, placeholders, aria labels) comes from the localization option. The default is English.

Each locale is its own module, so only the ones you import end up in your bundle:

<script lang="ts">
import { MaterialSvelteTable } from 'material-svelte-tanstack-table';
import { MRT_Localization_FR } from 'material-svelte-tanstack-table/locales/fr';
</script>
<MaterialSvelteTable options={{ columns, data, localization: MRT_Localization_FR }} />

There are 39 built in locales:

LanguageExportImport path
arMRT_Localization_ARmaterial-svelte-tanstack-table/locales/ar
azMRT_Localization_AZmaterial-svelte-tanstack-table/locales/az
bgMRT_Localization_BGmaterial-svelte-tanstack-table/locales/bg
csMRT_Localization_CSmaterial-svelte-tanstack-table/locales/cs
daMRT_Localization_DAmaterial-svelte-tanstack-table/locales/da
deMRT_Localization_DEmaterial-svelte-tanstack-table/locales/de
elMRT_Localization_ELmaterial-svelte-tanstack-table/locales/el
enMRT_Localization_ENmaterial-svelte-tanstack-table/locales/en
esMRT_Localization_ESmaterial-svelte-tanstack-table/locales/es
etMRT_Localization_ETmaterial-svelte-tanstack-table/locales/et
faMRT_Localization_FAmaterial-svelte-tanstack-table/locales/fa
fiMRT_Localization_FImaterial-svelte-tanstack-table/locales/fi
frMRT_Localization_FRmaterial-svelte-tanstack-table/locales/fr
heMRT_Localization_HEmaterial-svelte-tanstack-table/locales/he
hrMRT_Localization_HRmaterial-svelte-tanstack-table/locales/hr
huMRT_Localization_HUmaterial-svelte-tanstack-table/locales/hu
hyMRT_Localization_HYmaterial-svelte-tanstack-table/locales/hy
idMRT_Localization_IDmaterial-svelte-tanstack-table/locales/id
itMRT_Localization_ITmaterial-svelte-tanstack-table/locales/it
jaMRT_Localization_JAmaterial-svelte-tanstack-table/locales/ja
koMRT_Localization_KOmaterial-svelte-tanstack-table/locales/ko
mkMRT_Localization_MKmaterial-svelte-tanstack-table/locales/mk
nlMRT_Localization_NLmaterial-svelte-tanstack-table/locales/nl
noMRT_Localization_NOmaterial-svelte-tanstack-table/locales/no
npMRT_Localization_NPmaterial-svelte-tanstack-table/locales/np
plMRT_Localization_PLmaterial-svelte-tanstack-table/locales/pl
pt-BRMRT_Localization_PT_BRmaterial-svelte-tanstack-table/locales/pt-BR
ptMRT_Localization_PTmaterial-svelte-tanstack-table/locales/pt
roMRT_Localization_ROmaterial-svelte-tanstack-table/locales/ro
ruMRT_Localization_RUmaterial-svelte-tanstack-table/locales/ru
skMRT_Localization_SKmaterial-svelte-tanstack-table/locales/sk
sr-Cyrl-RSMRT_Localization_SR_CYRL_RSmaterial-svelte-tanstack-table/locales/sr-Cyrl-RS
sr-Latn-RSMRT_Localization_SR_LATN_RSmaterial-svelte-tanstack-table/locales/sr-Latn-RS
svMRT_Localization_SVmaterial-svelte-tanstack-table/locales/sv
trMRT_Localization_TRmaterial-svelte-tanstack-table/locales/tr
ukMRT_Localization_UKmaterial-svelte-tanstack-table/locales/uk
viMRT_Localization_VImaterial-svelte-tanstack-table/locales/vi
zh-HansMRT_Localization_ZH_HANSmaterial-svelte-tanstack-table/locales/zh-Hans
zh-HantMRT_Localization_ZH_HANTmaterial-svelte-tanstack-table/locales/zh-Hant

localization takes a partial object, and anything you leave out falls back to English. Spread a locale to change a few of its strings:

import { MRT_Localization_DE } from 'material-svelte-tanstack-table/locales/de';
localization: { ...MRT_Localization_DE, search: 'Suchen…', noRecordsToDisplay: 'Keine Einträge' },

Some strings contain placeholders in braces, for example filterByColumn: 'Filter by {column}' and groupByColumn: 'Group by {column}'. Keep the placeholders in your translation.

Type it as MRT_Localization and the compiler lists every key you still need:

import type { MRT_Localization } from 'material-svelte-tanstack-table';
export const MyLocale: MRT_Localization = {
language: 'xx',
// ...
};

The full list of keys is in the MRT_Localization type, and src/lib/locales/en.ts in the repository is a complete example to copy. Contributions of new or corrected locales are welcome.

Arabic (ar), Persian (fa) and Hebrew (he) read right to left. Set dir="rtl" on a parent element, and columnResizeDirection: 'rtl' if column resizing is enabled.

The date filters use the browser’s native date and time inputs, which follow the browser’s language rather than the table’s localization.