We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to change language in a gantt chart

Thread ID:

Created:

Updated:

Platform:

Replies:

146778 Aug 19,2019 04:19 PM UTC Aug 22,2019 11:12 AM UTC React - EJ 2 3
loading
Tags: Gantt Chart
Sebastian
Asked On August 19, 2019 04:19 PM UTC

Hi,I would like to know how to change the language for the gantt chart component, so that I change the text that is already in English by default.
Thanks in advance.

Gurunathan A [Syncfusion]
Replied On August 20, 2019 10:28 AM UTC

Hi Sebastin, 
 
We can translate the Gantt default text by using localization support, this can be done by calling setCulture method with required culture name and locale text value. Please find the code example below. 
 
 
import { L10n, setCulture } from '@syncfusion/ej2-base'; 
setCulture('es'); 
L10n.load({ 
  'es': { 
    'gantt': { 
      "id": "CARNÉ DE IDENTIDAD", 
      "name": "Nombre", 
      "startDate": "Fecha de inicio", 
      "endDate": "Fecha final", 
      "duration": "Duración", 
      "progress": "Progreso", 
      "dependency": "Dependencia", 
    }, 
  } 
});     
 
Please find the below documentation and sample link. 
 
We have also logged a UG documentation to provide details about the default locale text. It will be refreshed in our live URL at the mid of October 2019. 
 
You can find the default locale text for various culture for Gantt in below link.  
  
  
Please let us know if any further queries.  
 
Regards, 
Gurunathan  


Sebastian
Replied On August 21, 2019 10:52 PM UTC

Thank you very much it has helped me a little, but with this solution I have not been able to change the days and months, they still come out in English.

Gurunathan A [Syncfusion]
Replied On August 22, 2019 11:12 AM UTC

Hi Sebastin, 
 
In our previous update we have not included localized text for all the key words in sample, we have updated the sample with all key words, and we have also formatted the number and date objects using loadCldr method. Please find the below code example. 
 
 
  import { L10n, setCulture, loadCldr } from '@syncfusion/ej2-base'; 
  import * as cagregorian from "./ca-gregorian.json"; 
  import * as numbers from "./numbers.json"; 
  loadCldr(cagregorian, numbers); 
  setCulture('es'); 
  L10n.load({ 
      'es': { 
          'gantt': { 
              //... 
              "days": "días", 
           }, 
       } 
   }); 
 
Please find the updated sample link and UG documentation link below. 
 
Regards, 
Gurunathan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon