- Home
- Forum
- React - EJ 2
- How to change language in a gantt chart
How to change language in a gantt chart
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.
SIGN IN To post a reply.
3 Replies
GA
Gurunathan A
Syncfusion Team
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
SE
Sebastian
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.
GA
Gurunathan A
Syncfusion Team
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.
UG - https://ej2.syncfusion.com/react/documentation/common/internationalization/#cldr-data-dependencies
Gantt Keywords - https://github.com/syncfusion/ej2-locale/blob/master/src/es.json
Regards,
Gurunathan
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
SE Sebastian
- Aug 19, 2019 04:19 PM UTC
- Aug 22, 2019 11:12 AM UTC