Localization in React Data Grid

The Syncfusion® React Data Grid component includes a built-in Localization library to customize displayed text for different languages and cultural preferences. The static text on various elements can be adapted to languages such as "Arabic", "German", "French", and more by setting the locale property in a custom React Provider with a translation object.

Configuration steps

  1. Choose the desired locale for the application, as provided in the Syncfusion React localization resources.

  2. Install the @syncfusion/react-cldr-data package, which provides CLDR (Unicode Common Locale Data Repository) data for culture-specific formatting.

  3. Import the L10n class and loadCldr function from the @syncfusion/react-base package.

  4. Import the required localization files for the chosen language and the necessary CLDR data files:

  5. Call the loadCldr function with the imported data to enable formatting and parsing for the selected culture:

  6. Use the L10n.load method to load your translation object.

  7. Configure the locale property in the Provider to set the selected language.

Localized text configuration for Data Grid

The following locale keywords and their corresponding text can be customized for different grid features:

Data rendering

Locale keywordsTextExample
noRecordsMessageNo records to display

Columns

Locale keywordsTextExample
booleanTrueLabeltrue
booleanFalseLabelfalse

Editing

Locale keywordsTextExample
addButtonLabelAdd
editButtonLabelEdit
cancelButtonLabelCancel
updateButtonLabelUpdate
deleteButtonLabelDelete
confirmDeleteMessageAre you sure you want to delete the record?

Pager

Locale keywordsTextExample
currentPageLabel0 of 1 pages
totalItemsLabel(0 items)
firstPageTooltipGo to first page
lastPageTooltipGo to last page
nextPageTooltipGo to next page
previousPageTooltipGo to previous page
nextPageGroupTooltipGo to next page group
previousPageGroupTooltipGo to previous page group
pagerStatusMessagePager external message
pagerOfLabelof

Customizing locale text

To customize locale text by defining a translation object with the required key value pairs. Load the translation object using the L10n.load method and configure the locale property in the custom React Provider to apply the customized text.

Loading translations for culture

The Data Grid component includes a built-in Localization library that enables loading of translation objects for various languages. By utilizing the load method from the L10n class, the grid's text content can be customized to appear in the desired language.

This example demonstrates how to localize the grid using the L10n.load and loadCldr functions from the @syncfusion/react-base package. These functions enable dynamic culture switching and support for multiple languages and regional formats, allowing customized text content in the grid component.

Loading...

Set different locale text for two Data Grids in same page

The Data Grid component allows configuring different locale settings for multiple grids displayed on the same page. The L10n.load function from the @syncfusion/react-base library enables customization of text content to display in different languages. The following example demonstrates how to configure different locales for two grids on the same page.

Loading...

Internationalization

The Data Grid Internationalization library enables localized display of numbers, dates, and times based on the selected language and region. The format property enables customization of these values through format strings, reflects the desired cultural formatting.

The following sample demonstrates usage for "en-US (English)", "de (German - Germany)", "fr-CH (French - Azerbaijan)", "ar (Arabic)", and "zh (Chinese - China)" based on selected locale. The grid dynamically adjusts its number, date, and time formatting to align with the selected culture.

Loading...

See also