Using locale crashes control

Hi, if i use locale with any language, the control crashes. But using en-US locale works fine.

Image_4709_1725525708590




Attachment: SyncfusionMvcApplication4_eda63d9c.zip

7 Replies 1 reply marked as answer

RO Rodrigo September 5, 2024 08:43 AM UTC

Hi, i'm attaching the image where it works fine:


Image_9025_1725525785591



SR Swathi Ravi Syncfusion Team September 6, 2024 10:53 AM UTC

Hi Rodrigo,
Thank you for reaching out to us.
We appreciate your patience while we investigated the issue you reported. It appears that the problem is caused by the culture files not being loaded properly. To resolve this, please ensure that you load the appropriate culture files for the language you are using.
For detailed guidance on localization and globalization, you can refer to our documentation: Localization in the Schedule Component.
If you have any further questions or need additional assistance, please don't hesitate to let us know. We're here to help!
Best regards,
Swathi


RO Rodrigo replied to Swathi Ravi September 7, 2024 07:07 AM UTC

Hi Swathi, thank you for your quick response.


In my case im only tying Localization property, i'm not trying to use Globalization. 


I have followed the documentation in the link provided, but haven't been successfully working.


Could you send me an example using only Localization?


Much appreciated.


Re



VR Vijay Ravi Syncfusion Team September 9, 2024 01:57 PM UTC

Hi Rodrigo, 

if you can localize the language you can follow the below shared steps.

UG:  https://ej2.syncfusion.com/aspnetmvc/documentation/schedule/localization

We require the below files to localize the Schedule.

  • ca-gregorian.json
  • numbers.json
  • timeZoneNames.json
  • numberingSystems.json


1. You can get the above files by Installing the CLDR-Data package by using the below command.

>> npm install cldr-data –save


Once the installation is completed you can find the files required to localize the Schedule for each culture from the directory as shown below.



You can get ca-gregorian.jsonnumbers.json, and timeZoneNames.json files from the directory as shown below.






You can get the numberingSystems.json file from the directory as shown below. This file is common for all cultures.


2. Now use the loadCultureFiles method to load the culture-specific CLDR JSON data using Ajax as shown in the below code snippet.


[index.cshtml]


 loadCultureFiles('es');
 

 function loadCultureFiles(name) {

     var files = ['ca-gregorian.json', 'numberingSystems.json', 'numbers.json', 'timeZoneNames.json', 'ca-islamic.json'];

     var loader = ej.base.loadCldr;

     var loadCulture = function (prop) {

         var val, ajax;

         if (files[prop] === 'numberingSystems.json') {

             ajax = new ej.base.Ajax(location.origin + '/../Scripts/cldr-data/supplemental/' + files[prop], 'GET', false);

         } else {

             ajax = new ej.base.Ajax(location.origin + '/../Scripts/cldr-data/main/' + name + '/' + files[prop], 'GET', false);

         }

         ajax.onSuccess = function (value) {

             val = value;

         };

         ajax.send();

         loader(JSON.parse(val));

     };

     for (var prop = 0; prop < files.length; prop++) {

         loadCulture(prop);

     }

 }


3. Load the locale words as shown below using the load method of L10n. You can find the localized word for the different cultures from the below repository.


ej2-local:  https://github.com/syncfusion/ej2-locale


[index.cshtml]


ej.base.L10n.load({

 

"es": {

    "schedule": {

        "day": "Día",

        "week": "Semana",

        "workWeek": "Semana de trabajo",

        "month": "Mes",

        "agenda": "Agenda",

        "weekAgenda": "Agenda de la semana",

        "workWeekAgenda": "Agenda de la semana laboral",

        "monthAgenda": "Agenda del mes",

        "today": "Hoy",

        "noEvents": "No hay eventos",

        "emptyContainer": "No hay eventos programados para este día.",

        "allDay": "Todo el dia",

        "start": "comienzo",

        "end": "Final",

        "more": "más",

        "close": "Cerca",

        "cancel": "Cancelar",

        "noTitle": "(Sin título)",

        "delete": "Eliminar",

        "deleteEvent": "Este evento",

        "deleteMultipleEvent": "Eliminar múltiples eventos",

        "selectedItems": "Artículos seleccionados",

        "deleteSeries": "Serie completa",

        "edit": "Editar",

        "editSeries": "Serie completa",

        "editEvent": "Este evento",

        "createEvent": "Crear",

        "subject": "Tema",

        "addTitle": "Añadir título",

        "moreDetails": "Más detalles",

        "save": "Salvar",

        "editContent": "¿Cómo le gustaría cambiar la cita en la serie?",

        "deleteContent": "¿Seguro que quieres eliminar este evento?",

        "deleteMultipleContent": "¿Estás seguro de que deseas eliminar los eventos seleccionados?",

        "newEvent": "Nuevo evento",

        "title": "Título",

        "location": "Ubicación",

        "description": "Descripción",

        "timezone": "Zona horaria",

        "startTimezone": "Zona horaria de inicio",

        "endTimezone": "Zona horaria final",

        "repeat": "Repetir",

        "saveButton": "Salvar",

        "cancelButton": "Cancelar",

        "deleteButton": "Eliminar",

        "recurrence": "Reaparición",

        "wrongPattern": "El patrón de recurrencia no es válido.",

        "seriesChangeAlert": "¿Desea cancelar los cambios realizados en instancias específicas de esta serie y volver a vincularlos con toda la serie?",

        "createError": "La duración del evento debe ser más corta que la frecuencia con la que ocurre. Acorte la duración o cambie el patrón de recurrencia en el editor de eventos de recurrencia.",

        "sameDayAlert": "Dos ocurrencias del mismo evento no pueden ocurrir en el mismo día.",

        "editRecurrence": "Editar recurrencia",

        "repeats": "Repite",

        "alert": "Alerta",

        "startEndError": "La fecha de finalización seleccionada ocurre antes de la fecha de inicio.",

        "invalidDateError": "El valor de la fecha ingresada no es válido.",

        "blockAlert": "Los eventos no se pueden programar dentro del rango de tiempo bloqueado.",

        "ok": "Okay",

        "yes": "si",

        "no": "No",

        "occurrence": "Ocurrencia",

        "series": "Serie",

        "previous": "Anterior",

        "next": "próximo",

        "timelineDay": "Día de la línea de tiempo",

        "timelineWeek": "Semana de la línea de tiempo",

        "timelineWorkWeek": "Semana laboral cronológica",

        "timelineMonth": "Mes de la línea de tiempo",

        "timelineYear": "Cronología Año",

        "editFollowingEvent": "Eventos siguientes",

        "deleteTitle": "Eliminar evento",

        "editTitle": "Editar evento",

        "beginFrom": "Comience desde",

        "endAt": "Termina en"

    },

    "recurrenceeditor": {

        "none": "Ninguna",

        "daily": "Diario",

        "weekly": "Semanal",

        "monthly": "Mensual",

        "month": "Mes",

        "yearly": "Anual",

        "never": "Nunca",

        "until": "Hasta",

        "count": "Contar",

        "first": "primero",

        "second": "Segundo",

        "third": "Tercero",

        "fourth": "Cuarto",

        "last": "Último",

        "repeat": "Repetir",

        "repeatEvery": "Repite cada",

        "on": "Repetir en",

        "end": "Final",

        "onDay": "Día",

        "days": "Dias)",

        "weeks": "Semanas)",

        "months": "Meses)",

        "years": "Años)",

        "every": "cada",

        "summaryTimes": "veces)",

        "summaryOn": "en",

        "summaryUntil": "hasta",

        "summaryRepeat": "Repite",

        "summaryDay": "dias)",

        "summaryWeek": "semanas)",

        "summaryMonth": "meses)",

        "summaryYear": "años)",

        "monthWeek": "Mes Semana",

        "monthPosition": "Posición del mes",

        "monthExpander": "Expansor de mes",

        "yearExpander": "Expansor de año",

        "repeatInterval": "Intervalo de repetición"

    },

    "calendar": {

        "today": "Hoy"

    }
  }

});


4. Set the locale property to the Schedule.


[index.cshtml]


@using Syncfusion.EJ2.Schedule

 

@Html.EJS().Schedule("schedule")

.Width("100%")

.Locale("es")

.Height("550px")

.EventSettings(new ScheduleEventSettings { DataSource = ViewBag.datasource })

.SelectedDate(new DateTime(2018, 2, 15))

.Render()


Don't hesitate to get in touch if you require further help or more information.

Regards,

Vijay


Attachment: SyncfusionMvcApplication4_cb689f97.zip

Marked as answer

RO Rodrigo replied to Vijay Ravi September 13, 2024 05:25 AM UTC

Thank you Vijay.


Regards.



RO Rodrigo replied to Rodrigo September 13, 2024 06:50 AM UTC

Hi Vijay, your solution works great for locale=es and globalization=es, in my case i'm using locale=es and globalization=es-SV


Using this configuration crashes again, i've added the required files but doesn't work properly.


Could you check? thank you.


Image_1095_1726210177370




Image_8533_1726210188386


Attachment: SyncfusionMvcApplication5_c0d3cf90.zip


SR Swathi Ravi Syncfusion Team September 16, 2024 01:36 PM UTC

Hi Rodrigo,

Thank you for reaching out.

For the issue you're encountering, it's important to use matching values for both the locale and globalization settings. In your case, you should use the same key for both locale and globalization. For example, if you are using locale=es, you should also use globalization=es instead of es-SV.

 

If you continue to experience any issues or need further assistance, please feel free to contact us.

 

Regards,

Swathi


Loader.
Up arrow icon