Change the language from English to Spanish

Hi,
There is some way to change the languaje globally, so that all the components that are implemented are read in Spanish.
Regards!

5 Replies

BM Balaji M Syncfusion Team August 13, 2018 05:22 PM UTC

Hi Corazon 

Thanks for contacting Syncfusion support. 

We can set the language as globally by using setCulture() method in your application as like in the below code sample.  

 
<h4>DatePicker:</h4> 
<ej-date-picker id="datepicker" value="@DateTime.Now"></ej-date-picker> 
<h4>DateTimePicker:</h4> 
<ej-date-time-picker id="datetimepicker" value="@DateTime.Now"></ej-date-time-picker> 
<h4>DateRangePicker:</h4> 
<ej-date-range-picker id="daterangepicker></ej-date-range-picker> 
<h4>TimePicker:</h4> 
<ej-time-picker id="timepicker" value="@DateTime.Now"></ej-time-picker> 
 
<script> 
    // $(document).ready(function () { 
    document.addEventListener("DOMContentLoaded", function () { 
        if (typeof (ej.globalize) != 'undefined') { 
            ej.setCulture("es-ES");//set Culture es-ES 
        } 
    }) 
</script> 
 
 
Before the culture initialization, need to load the corresponding culture files in your application. We have referred the Spanish culture related files in layout.cshtml page.(Each culture has its own locale and localetexts files) 

_layout.cshtml 


<!--refer the spanish culture locale file--> 
<!--refer the spanish culture localetext file--> 
 
 
 
The Syncfusion components supported locale files are available in this GitHub link. https://github.com/syncfusion/ej-global 

Also, we have created the sample by using setCulture() method to initialize the all components in Spanish culture. Please get the sample from the below location. 

 
To know more about globalization, please refer the below documentation link. 


Please let us know if you have any queries. 

Regards, 
M. Balaji 



CC Corazon Cruz Sanchez August 13, 2018 08:36 PM UTC

Hi Balaji,

Thank you very much, I solved my problem.

Regards!






BM Balaji M Syncfusion Team August 14, 2018 11:35 AM UTC

Hi Corazon  
 
Most welcome. We are happy to hear that reported query is solved.  
 
  
Regards, 
M. Balaji 



BG BYTELABZ GT June 8, 2023 03:29 AM UTC

im using a react app, and i want to know which packages i need to add to my proyect to be able to change the language



AR Anbumani Rajendracholan Syncfusion Team June 14, 2023 11:44 AM UTC

Hi  BYTELABZ GT,


Greetings from Syncfusion support.


We would like to inform you that when you install the node modules using the command "npm install cldr-data", all languages will be installed in the "cldr-data" folder of the node modules in your application. You can import the specific language that you want and apply it in your application. For your convenience, we have created a simple React application to utilize the Spanish culture using the setCulture method. In the application, we have changed the culture from English to Spanish through the setCulture method in the button click event. Kindly refer to the attached sample and documentation below for further references.

 

The locale text package has been made available on npm and our GitHub repository. You can find the relevant links below.

 

npm: https://www.npmjs.com/package/@syncfusion/ej2-locale

 

Github: https://github.com/syncfusion/ej2-locale/tree/master/src

 

Documentation: https://ej2.syncfusion.com/react/documentation/common/globalization/internationalization


sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/React_locale-767013665.zip

Please get back to us if you need further assistance.

 

Regards,

Anbumani Rajendracholan


Loader.
Up arrow icon