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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding custom locale language for javascript controls

HOW TO ADD CUSTOM LANGUAGE TO JAVASCRIPT CONTROLS

 

We can add our custom language to JavaScript controls by following some simple steps mentioned below,

We already have localization file for en-US (English). Hence, ‘en-US’ locale is currently being used as default culture or you can also make the following change in it to convert it to your desired language file.

locale text file of en-US is in the following location :”{ installed location}\assets\scripts\ localetexts\ej.localetexts.en-US.js”.

Steps to be followed to your language to JavaScript Controls.

  1. Choose any language, find the globalize name (locale object) for the desired culture and say, for example, French. The locale object for French is [fr-FR].

 

  1. Change the locale object name and the key values for required control class. Consider the ejDatePicker for example, change the locale object value for ejDatePicker (from ['en-US'] to ['fr-FR']) and key values (e.g., from "Select date" to "Sélectionner une date") as follows.

 

        The above ej.Datepicker object has been changed to,

 

  1. Refer culture script of this fr-FR in your application after the reference of ej.web.all.min.js file.

 

  1. Set your preferred culture by assigning corresponding culture object to locale property of ejDatePicker as shown below:

 

  1. Copy the ej.Datepicker object formed in step 2, directly in the html within script tag or create a JavaScript file and then refer the file in the sample.

  1. The final html of your application for adding custom Locale will be like below given content

 

The output of the sample html code in previous step is given below:

ejDatePicker in French

 

You can also refer the below link to know about localization of ejDatePicker.

Link: http://js.syncfusion.com/demos/web/#!/azure/datepicker/localization

Article ID: Published Date: Last Revised Date: Platform: Control:
6218 02/05/2016 02/05/2016 JavaScript General
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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