React Spreadsheet localization
React Spreadsheet provides two separate localization mechanisms for different aspects of the UI.
Two localization mechanisms
| Mechanism | Prop | What it controls |
|---|---|---|
| UI localization | spreadsheetLocale | Menu labels, toolbar tooltips, dialog text, and localized formula names |
| Number/date formatting | localization | Decimal separator, currency symbol, date/time display format |
These props are independent: you can use either or both.
UI localization (spreadsheetLocale)
The spreadsheetLocale prop accepts a SpreadsheetLocale object with two properties:
locale- aRecord<string, string>of UI string overridesformulas- aRecord<string, [string, string?][]>of localized formula names grouped by category
const locale: SpreadsheetLocale = {
locale: {
"File": "Datei",
"Edit": "Bearbeiten",
"Insert": "Einfügen",
"Undo": "Rückgängig",
"Redo": "Wiederherstellen",
// ... more UI strings
},
formulas: {
"MATCH": [
["Suchwert", "Erforderlich. Der Wert, der im Sucharray abgeglichen werden soll."],
["Sucharray", "Erforderlich. Ein Zellbereich oder ein Array-Bezug."],
],
// ... more formula categories
},
};
<ReactSpreadsheet sheets={sheets} spreadsheetLocale={locale} />
warning
spreadsheetLocale is an init-only prop. Changing it after the initial render causes the widget to be destroyed and recreated. Undo/redo history and UI state (selection, scroll position) are reset.
Number/date formatting (localization)
The localization prop controls how numbers and dates are displayed: decimal separators, currency symbols, date patterns, etc. It uses the same format as the DHTMLX Spreadsheet localization configuration property.
<ReactSpreadsheet
sheets={sheets}
localization={{
decimal: ",",
thousands: " ",
currency: "€",
}}
/>
warning
localization is also an init-only prop. Changes trigger a full destroy/recreate cycle.
Related API and guides
- Localization - DHTMLX Spreadsheet localization guide
- SpreadsheetLocale type - TypeScript interface reference