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: 

<ScheduleComponent
        locale="es"
        width="100%"
        height="100%"
        firstDayOfWeek={1}
        currentView="Month"
        navigating={onNavigate}
        cellClick={onCellClick}
        popupOpen={onPopupOpen}
        eventRendered={onEventRendered}
        rowAutoHeight={currentView === "TimelineMonth"}
        eventSettings={{
          dataSource: data,
          fields: {
            id: "id",
            subject: { name: "subject", title: "Nombre" },
            location: { name: "location", title: "Ubicación" },
            description: { name: "description", title: "Descripción" },
            startTime: { name: "startTime", title: "Fecha inicio" },
            endTime: { name: "endTime", title: "Fecha fin" },
            isAllDay: { name: "isAllDay", title: "Es todo el día" },
          },
        }}
      >

I really need your help, i don't know what to do...

Thank you in advance!!


1 Reply

VS Venkateshwaran Saravanakumar Syncfusion Team July 14, 2023 03:02 PM UTC

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 { loadCldrL10nsetCulture } 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


Loader.
Up arrow icon