BoldSign®Effortlessly integrate e-signatures into your app with the BoldSign® API. Create a sandbox account!
Hi, if i use locale with any language, the control crashes. But using en-US locale works fine.
Hi, i'm attaching the image where it works fine:
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
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.
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.json, numbers.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
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.
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