Hi Dipesh,
Greetings from Syncfusion support.
Based on the query we would like to let you know that for globalizing the number(including currency formats) and date values you need to load the corresponding culture files from the ‘cldr-data’ package in addition to setting the required currency code in the base’s setCurrencyCode method.
So for globalizing the currency and date values in your application’s EJ2 Grid(according to the culture set), you need to set the required culture using the EJ2 base’s setCulture method and the required currency format using its setCurrencyCode method. Then, you need to load the following culture files from the cldr-data of the ’node modules’ – ['ca-gregorian.json', 'numbers.json', 'currencies.json', 'timeZoneNames.json'] from the required culture(In your case – ‘en-GB’) present inside the main folder and the ['numberingSystems.json''weekData.json'(For calendar rendered on Grid filtering)] file from the supplemental folder in your application using EJ2 base’s loadCldr method.
This is demonstrated in the below code snippet,
declare var require: any
import { loadCldr, setCulture, L10n, setCurrencyCode } from '@syncfusion/ej2-base';
setCulture('en-GB');
setCurrencyCode('GBP');
loadCldr(require('cldr-data/main/en-GB/currencies.json'),
require('cldr-data/main/en-GB/numbers.json'),
require('cldr-data/main/en-GB/ca-gregorian.json'),
require('cldr-data/main/en-GB/timeZoneNames.json'),
require('cldr-data/supplemental/numberingSystems.json'),
require('cldr-data/supplemental/weekData.json')
); |
You can also localize the default text content of the Grid by loading the translation texts for the required culture from the “@syncfusion/ej2-locale” package by using the base’s L10n load function. This is demonstrated in the below code snippet for ‘en-GB’ culture,
declare var require: any
import { L10n } from '@syncfusion/ej2-base';
L10n.load(require('@syncfusion/ej2-locale/src/en-GB.json')); |
List of locale texts for supported cultures which can be loaded for the EJ2 controls can be checked in the below link,
We have prepared a sample based on this for your reference. You can find it below,
More details on the globalization and localization for EJ2 Grid can be checked in the below help documentation links,
Please get back to us if you require any further assistance.
Regards,
Sujith R