Change to Spanish Languague

Im trying to change the languague of my Scheduler to Spanish, i have tryed solutions for other thread related but i havent been able to succeed.

I alrready declared the loadCldr, and L10n, as some examples as follow: 

 Image_6493_1722445899607 

And initialize my shceduler in locale("es"):

Image_7311_1722445899607

But after loading my scheduler get a undefined error and wont load, i dont know what causes this if im missing some traduction somewhere:

Image_6262_1722445899607


3 Replies

SR Swathi Ravi Syncfusion Team August 1, 2024 01:35 PM UTC

Hi Arturo,

Thank you for reaching out.  You can globalize the Schedule with the Spanish culture by following the steps.



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.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. Import the required CLDR data files and locale words as shown below and load them using loadCldr and load method of L10n.
You can find the localized word for the different cultures from the below repository.
[app.component.ts]
 import { loadCldr, L10n, setCulture } from '@syncfusion/ej2-base';
import * as numberingSystems from './numberingSystems.json';
import * as gregorian from './ca-gregorian.json';
import * as numbers from './numbers.json';
import * as timeZoneNames from './timeZoneNames.json';

loadCldr(numberingSystems, gregorian, numbers, timeZoneNames);

L10n.load({
  es: {
    "schedule": {
      "day": "Día",
      "week": "Semana",
      "workWeek": "Semana laboral",
      "month": "Mes",
      "year": "Año",
      "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": "Inicio",
      "end": "Fin",
      "more": "más",
      "close": "Cerrar",
      "cancel": "Cancelar",
      "noTitle": "(Sin título)",
      "delete": "Borrar",
      "deleteEvent": "Este evento",
      "deleteMultipleEvent": "Eliminar Varios eventos",
      "selectedItems": "Elementos seleccionados",
      "deleteSeries": "Serie completa",
      "edit": "Editar",
      "editSeries": "Serie completa",
      "editEvent": "Este evento",
      "createEvent": "Crear",
      "subject": "Asunto",
      "addTitle": "Añadir título",
      "moreDetails": "Más detalles",
      "save": "Guardar",
      "editContent": "¿Cómo le gustaría cambiar la cita en la serie?",
      "deleteContent": "¿Está seguro de que desea 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": "Iniciar zona horaria",
      "endTimezone": "Fin de la zona horaria",
      "repeat": "Repetir",
      "saveButton": "Guardar",
      "cancelButton": "Cancelar",
      "deleteButton": "Eliminar",
      "recurrence": "Repetició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 compararlos 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 periodicidad en el editor de eventos de periodicidad.",
      "sameDayAlert": "Dos ocurrencias del mismo evento no pueden ocurrir en el mismo día.",
      "occurenceAlert": "No se puede reprogramar una aparición de la cita periódica si omite una aparición posterior de la misma cita.",
      "editRecurrence": "Editar periodicidad",
      "repeats": "Repite",
      "alert": "Alerta",
      "startEndError": "La fecha de finalización seleccionada se produce 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": "De acuerdo",
      "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": "Cronograma Semana Laboral",
      "timelineMonth": "Mes de la línea de tiempo",
      "timelineYear": "Cronología Año",
      "editFollowingEvent": "Siguientes eventos",
      "deleteTitle": "Eliminar evento",
      "editTitle": "Editar evento",
      "beginFrom": "Comenzar desde",
      "endAt": "Fin en",
      "expandAllDaySection": "Expandir la sección de todo el día",
      "collapseAllDaySection": "Contraer sección de todo el día",
      "searchTimezone": "Zona horaria de búsqueda",
      "noRecords": "No se encontraron registros"
    },
    "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": "Día(s)",
      "weeks": "Semana(s)",
      "months": "Mes(es)",
      "years": "Año(s)",
      "every": "cada",
      "summaryTimes": "vece(s)",
      "summaryOn": "en",
      "summaryUntil": "hasta",
      "summaryRepeat": "Repite",
      "summaryDay": "día(s)",
      "summaryWeek": "semana(s)",
      "summaryMonth": "mes(es)",
      "summaryYear": "año(s)",
      "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"
    },
  }
});
3. Finally set up the locale property to the Schedule as shown below.
 
ejs-schedule width='100%' height='550px' locale='es' [selectedDate]="selectedDate" [eventSettings]="eventSettings" [views]='views' locale="es"></ejs-schedule>



Let us know if this resolves the issue or if you need any further assistance. We are here to help!

Best regards,  
Swathi Ravi


AM Arturo Martinez August 1, 2024 03:36 PM UTC

Im not getting any errors now, but my scheduler still wont load, and it only seems to have half the info in Spanish.

Image_1016_1722526571356



If i use the global import method i get an error

Image_2433_1722526571356Image_8474_1722526571356 



SR Swathi Ravi Syncfusion Team August 2, 2024 12:02 PM UTC

Arturo,

Thank you for providing the details and images.

We see that you are using the Timeline views in the Scheduler. The issue you're experiencing typically occurs when resource grouping is used with an empty resource in the Scheduler. Please ensure that when grouping resources, the datasource for the Scheduler includes the necessary resource information. Without this, the Scheduler will render with empty headers.

For more information, please refer to our documentation on grouping with empty resources.

If still you are facing the same issue, share the entire schedule related code snippets. This information will be very helpful in assisting you better and providing a more effective solution.


Loader.
Up arrow icon