How to change components language with translated static files ?

 Hi,

I found translations files in https://github.com/syncfusion/ej2-locale. How to apply on Angular component. For example i would like to change scheduler static fields value with transleted value.

Bests,
Tümer

5 Replies

VM Vengatesh Maniraj Syncfusion Team February 14, 2020 06:29 AM UTC

Hi Tumer, 

Greetings from Syncfusion Support. 

Kindly refer to the below UG documentation to change the Schedule’s static fields. 


Kindly revert us for further assistance. 

Regards, 
Vengatesh 



Tümer February 14, 2020 03:03 PM UTC

Hi

Thanks for your response. I've already read documentation but i confused that how can i call translated fields from a file. For example i have tr.json file and all components were translated. I think it's not a good practice load all field row by row in a component.ts.  L10nLoad(tr.scheduler) is more fine than following code.I'm searching something like this.


L10n.load({
  'tr': {
      'schedule': {
          'saveButton': 'Kaydet',
          'cancelButton': 'İptal',
          'deleteButton': 'Sil',
          'newEvent': 'Yeni Danışan Randevu Kayıt',
          'addTitle':'Hızlı Randevu',
          'save':'Kaydet',
          'moreDetails':'Daha',
          'editEvent':'Randevu Güncelle',
          "day": "Gün",
          "week": "Hafta",
          "workWeek": "Çalışma haftası",
          "month": "Ay",
          "agenda": "Gündem",
          "weekAgenda": "Hafta Gündemi",
          "workWeekAgenda": "Çalışma Haftası Gündemi",
          "monthAgenda": "Ay Gündemi",
          "today": "Bugün",
          "noEvents": "Olay yok",
          "emptyContainer": "Bu günde planlanmış etkinlik yok.",
          "allDay": "Tüm gün"

      },
      'datetimepicker':{
        'today':'Bugün'
      }
  }
});


VM Vengatesh Maniraj Syncfusion Team February 17, 2020 06:56 AM UTC

Hi Tümer, 
 
Thanks for the update. 
 
To translate the field, we need to load the culture file what we are going to use like below, 
 
loadCldr( 
      require('../../node_modules/cldr-data/supplemental/numberingSystems.json'), 
      require('../../node_modules/cldr-data/main/tr/ca-gregorian.json'), 
      require('../../node_modules/cldr-data/main/tr/currencies.json'), 
      require('../../node_modules/cldr-data/main/tr/numbers.json'), 
      require('../../node_modules/cldr-data/main/tr/timeZoneNames.json') 
    ); 
 
And the same we have to set to the Schedule’s locale property like below, 
 
<ejs-schedule #schedule height='550px' locale='tr' [(selectedDate)]="selectedDate" [eventSettings]="eventSettings"> 
        </ejs-schedule> 
 
We have prepared the sample with tr culture file which can be downloaded from below link, 
 
 
Please try the above sample and revert us if you need any further assistance. 
 
Regards, 
Vengatesh 



Tümer February 20, 2020 10:17 AM UTC

Hi Vengatesh,

Thanks for your attention and sample code. It solved my problem..

Bests,
Tümer




VM Vengatesh Maniraj Syncfusion Team February 20, 2020 10:52 AM UTC

Hi Tümer, 
 
Thanks for the update. 
 
We are happy that our solution has fulfilled your requirement. 
 
Please let us know if you need any other assistance. 
 
Regards,
Vengatesh
 


Loader.
Up arrow icon