Change language

Hi, good afternook, i come again here to ask some questions, i'm trying to change the default lenguage to Spanish in my schedule, i read a lot of threads with same problem but i can't solve it. This is my html: 

<ejs-schedule #scheduleObj [locale]="es" width="100%" height="550px" [selectedDate]="selectedDate"
                  [views]="views" [eventSettings]="eventSettings" [group]='group' (popupOpen)='onPopupOpen($event)'
                  (actionBegin)="onActionBegin($event)" (eventRendered)="onEventRendered($event)"
                  (actionComplete)='onActionComplete($event)'>
                  <e-resources>
                    <e-resource field="OwnerId" title="Owner" name="Owners" [dataSource]="ownerDataSource"
                      [allowMultiple]="allowMultipleCategory" textField='OwnerText' idField='Id'
                      colorField='OwnerColor'>
                    </e-resource>
                  </e-resources>
                </ejs-schedule>

When i put [locale]="es" in the browser schedule looks as image below (and no appear any problem in console). 

My main question is can be a problem with versions? i'm using these from syncfusion: 

"@syncfusion/ej2-angular-dropdowns": "^18.4.43",
    "@syncfusion/ej2-angular-schedule": "^20.2.38-ngcc",

i had to uso the 20.2.39-ngcc because project uses Angular 8 and new versions bring compatibilities problems.

My ts looks:

setCulture('es')

declare let require: Function;
loadCldr(
  require('../../../../node_modules/cldr-data/supplemental/numberingSystems.json'),
  require('../../../../node_modules/cldr-data/main/es/ca-gregorian.json'),
  require('../../../../node_modules/cldr-data/main/es/currencies.json'),
  require('../../../../node_modules/cldr-data/main/es/numbers.json'),
  require('../../../../node_modules/cldr-data/main/es/timeZoneNames.json')
);

L10n.load({
  "es": {
    "schedule": {
      "day": "Día",
      "week": "Semana",
  }
});

ngOnInit() {
    this.scheduleObj.locale = 'es'
  }

 borrar.PNG


if there is any solution (even hard-coded) is welcome

Thanks very much again!


1 Reply

RM Ruksar Moosa Sait Syncfusion Team September 5, 2022 11:37 AM UTC

Hi Ramiro,


We have checked on your query and suggest you the remove the property  [locale]="es" declared in the html file when you set the locale on ngOnInit method to resolve your reported issue. We have prepared a sample for your reference.


Sample: https://stackblitz.com/edit/ej2-angular-schedule-with-spanish-es-locale-gc9so-y4hj1v?file=app.component.ts,app.component.html


Output:

Chart, waterfall chart

Description automatically generated


Kindly try the above sample and let us know if this meets your requirement.


Regards,

Ruksar Moosa Sait


Loader.
Up arrow icon