UploadBox events do not respect language

Hi,

I have the option to change from English to Spanish controls, when occupying control events uploadbox the following links:

https://help.syncfusion.com/api/js/ejuploadbox#events:cancel  

Events 

$("#UploadFile").ejUploadbox({
cancel: function (args) {
location.reload(true);
}
});


$("#UploadFile").ejUploadbox({ dialogPosition: { X: 250, Y: 40 } });


I do not respect the language change, the controls are returned to English.

Is there any option on how to solve it?

Regards!

8 Replies

SK Shanmugaraja K Syncfusion Team August 20, 2018 11:41 AM UTC

Hi Corazon, 
 
Thank you for using Syncfusion products. 
 
We suggest you to use the locale property in the ejUploadbox control. You need to define locale for the Spanish language and assign it to the Upload box’s locale property in your application. This will change the display text in the control from English to Spanish. Kindly refer to the following API reference for more information: 
 
 
Regards, 
Shanmugaraja K 
 



CC Corazon Cruz Sanchez August 20, 2018 03:23 PM UTC

Hi Shanmugaraja,


I already use the following code, but my question is: if for each control that occupies members will have to put the locate, there is some form that avoids putting it for each control that uses.
ej.Uploadbox.Locale["nl-BE"] = {
buttonText: {
upload: "Subir",
browse: "Subir Archivo",
cancel: "Cancelar",
close: "Cerrar"
},
dialogText: {
title: "Archivo",
name: "Nombre",
size: "Tamaño",
status: "Estatus"
},
cancelToolTip: "Cancelar",
removeToolTip: "Eliminar",
retryToolTip: "Eliminar",
completedToolTip: "Completado",
failedToolTip: "Fallo",
closeToolTip: "Cerrar"
};
$("#UploadFile").ejUploadbox({ locale: "nl-BE" });

There is some way that I continue to respect the general configuration that syncfusion offers, so as not to be placing locate for each control that uses javascript API
The configuration is the following:


Regards


CC Corazon Cruz Sanchez replied to Corazon Cruz Sanchez August 20, 2018 03:24 PM UTC

Hi Shanmugaraja,


I already use the following code, but my question is: if for each control that occupies members will have to put the locate, there is some form that avoids putting it for each control that uses.
ej.Uploadbox.Locale["nl-BE"] = {
buttonText: {
upload: "Subir",
browse: "Subir Archivo",
cancel: "Cancelar",
close: "Cerrar"
},
dialogText: {
title: "Archivo",
name: "Nombre",
size: "Tamaño",
status: "Estatus"
},
cancelToolTip: "Cancelar",
removeToolTip: "Eliminar",
retryToolTip: "Eliminar",
completedToolTip: "Completado",
failedToolTip: "Fallo",
closeToolTip: "Cerrar"
};
$("#UploadFile").ejUploadbox({ locale: "nl-BE" });

There is some way that I continue to respect the general configuration that syncfusion offers, so as not to be placing locate for each control that uses javascript API
The configuration is the following:


Regards

<script src="http://cdn.syncfusion.com/js/assets/i18n/ej.culture.es-ES.min.js"></script>
<script src="http://cdn.syncfusion.com/16.2.0.46/js/l10n/ej.localetexts.es-ES.min.js"></script>

<script>
document.addEventListener("DOMContentLoaded", function () {

if (typeof (ej.globalize) != 'undefined') {
ej.setCulture("es-ES");//set Culture es-ES
}
})
</script>



SK Shanmugaraja K Syncfusion Team August 21, 2018 11:16 AM UTC

Hi Corazon,  
 
Thank you for your update.  
 
We have checked your requirement “General configuration that Syncfusion offers to avoid placing locale for each control” and it can be achieved by using “ej.setCulture()” method before rendering the controls. Based on the code snippet you have shared, we found that you are applying the culture after rendering the control. So, we have prepared a simple JS Playground sample to apply Spanish culture “es-ES” before rendering the controls. Please refer the below code example.  
 
JS  
<script>  
    $(function () {  
        ej.setCulture("es-ES");//set Culture es-ES  
        $("#UploadFile").ejUploadbox();  
        $("#DatePicker").ejDatePicker(); 
    });  
</script>  
 
 
 
Could you please check the above sample and get back to us if we misunderstood your requirement or you need any further assistance on this?  
 
Regards,  
Shanmugaraja K 



CC Corazon Cruz Sanchez August 21, 2018 03:38 PM UTC

Hi Shanmugaraja,

Thank you for assisting me

I added the following script to the control and it does not respect the language. Attached evidence.







SK Shanmugaraja K Syncfusion Team August 22, 2018 07:01 AM UTC

Hi Corazon, 
 
Thank you for your update, 
 
We have checked your attached screenshot, we can see you have added ejUploadbox rendering code two times in your page, we suggest you to add one time after using the setCulture method. Please refer the below codes, 
 
[HTML
 
 
<script> 
        $(function () { 
              ej.setCulture("es-ES");//set Culture es-ES. 
              $("#UploadFile").ejUploadbox({ dialogPosition:{ X: 250, Y: 40}}); 
              $("#DatePicker").ejDatePicker(); 
       }); 
</script> 
<div id="UploadFile"></div> 
<input id="DatePicker" style="margin: 35px auto" /> 
 
 
We have modified the previously provided sample. Please find the below link, 
 
 
Could you please try the above sample, and check whether this fulfilling your requirement? If not please get back to us with more information. 
 
Regards, 
Shanmugaraja K 



CC Corazon Cruz Sanchez August 22, 2018 02:56 PM UTC

Hi Shanmugaraja,

It is already solved,thank you very much!!  :)

Regards.


KV Karthikeyan Viswanathan Syncfusion Team August 23, 2018 06:06 AM UTC

Hi Corazon,  
 
Thanks for the update.   
We are glad to hear that your issue has been resolved. 
 
Regards,  
Karthikeyan V.  


Loader.
Up arrow icon