- Home
- Forum
- React - EJ 2
- Locale="es" not working
Locale="es" not working
Hello! So, im trying to change the lenguage of my component but it doesn't work. I tried to add locale="es" locale="es-ES" and also setCulture("es) but not working. When i take it off the component runs perfect but in english... But when i add the locale all the screen turns white. I was using the free version and i though that was the problem. Then i added the 30 days free trial version key but still not work.
This is my component:
I really need your help, i don't know what to do...
Thank you in advance!!
Hi Juan,
Sample: https://stackblitz.com/edit/react-2djup5-feajy5?file=index.js
UG: https://ej2.syncfusion.com/react/documentation/schedule/localization
Based on your query, we have prepared a sample of a React Scheduler with
dynamically changing localization support. We did not encounter any issues with
localization. We suspect that you may not have properly imported the loadCldr
method, which is responsible for loading locale-specific information such as
numbers, time zones, and calendars in your component.
[index.js]
|
import { loadCldr, L10n, setCulture } from '@syncfusion/ej2-base';
loadCldr( require('./cldr-data/supplemental/numberingSystems.json'), require('./cldr-data/main/es/ca-gregorian.json'), require('./cldr-data/main/es/numbers.json'), require('./cldr-data/main/es/timeZoneNames.json'), require('./cldr-data/main/en-US/ca-gregorian.json'), require('./cldr-data/main/en-US/numbers.json'), require('./cldr-data/main/en-US/timeZoneNames.json') );
|
[locale.json]
Ensure that you have imported the localization file in your component and make
sure that the required cultures are imported correctly. The code
L10n.load(localeData) is used to load the localization data stored in the
localeData variable. This data is likely sourced from a JSON file
(locale.json), and it contains the necessary translations and formatting
options for the supported languages or regions. Please ensure that you have
provided the respective localization words in the JSON file with correct key
values. Also, check whether you have used the same key values in all the
required places. These measures will resolve your issue.
[index.js]
|
const localeData = require('./locale.json');
L10n.load(localeData);
|
[ca-gregorian.json]
[numbers.json]
Regards,
Venkatesh
- 1 Reply
- 2 Participants
-
JR Juan Reig
- Jul 13, 2023 11:48 AM UTC
- Jul 14, 2023 03:02 PM UTC