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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Loading CLDR Data on Runtime to Reduce Build Size

Thread ID:





140969 Nov 16,2018 11:18 AM UTC Nov 19,2018 12:39 PM UTC ASP.NET Core - EJ 2 1
Tags: General
Mehmood Ahmed
Asked On November 16, 2018 11:18 AM UTC


I have observed that cldr-data package is added as a dependency by default. But, can we separate it from main.ts and load it on run-time? Because, the package increases my build size from a couple MBs to 20MB.


Jesus Arockia Sankaran S [Syncfusion]
Replied On November 19, 2018 12:39 PM UTC

Hi Mehmood,  

Thanks for contacting Syncfusion support.  

We suggest you to load cldr files using Ajax post to reduce the bundle size. 

Please find the below code example for your reference. 

//loading locale files 
    'de': { 
        'calendar': { today: 'heute' } 
    "ar": { 
        "calendar": { 
            today: 'اليوم' 
//Function for loading locale files based on culture name 
function loadCultureFiles(name:any) { 
    let files: string[] = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json']; 
    if (name === 'ar') { 
     let loadCulture = function (prop:any) { 
        let val:string, ajax: Ajax; 
        if (name === 'ar' && prop === files.length - 1) { 
            ajax = new Ajax( './node_modules/cldr-data/supplemental/' + files[prop], 'GET', false); 
        } else { 
            ajax = new Ajax( './node_modules/cldr-data/main/' + name + '/' + files[prop], 'GET', false); 
        ajax.onSuccess = function (value:any) { 
            val = value; 
    for (let prop = 0; prop < files.length; prop++) { 
For your convenience we have created a typescript application to load cldr files using Ajax and the same can be referred from the below link. 


Please get back to us if you require any further assistance on this.  

Jesus Arockia Sankaran S 


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