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

Change global culture and currency

Thread ID:

Created:

Updated:

Platform:

Replies:

141521 Dec 15,2018 12:40 PM UTC Dec 18,2018 09:45 AM UTC ASP.NET Core - EJ 2 1
loading
Tags: Numeric TextBox
Stefan
Asked On December 15, 2018 12:40 PM UTC

Hi

I’m trying to change global culture and currency in my project following this article:


I don’t understand how to reference the installed cldr-data packages? Do you have a complete working sample of this? I’m primary working with grid and numericTextBox.

/S

Christopher Issac Sunder K [Syncfusion]
Replied On December 18, 2018 09:45 AM UTC

Hi Stefan, 

Thank you for contacting Syncfusion support.  
 
You can follow the below code block to refer the installed cldr-data packages json files in your application.  

[Layout.cshtml] 

<script src="https://cdn.syncfusion.com/ej2/dist/ej2.min.js"></script> 
<script> 
    var L10n = ej.base.L10n; 
    L10n.load({ 
        'sv': { 
            'numerictextbox': { 
                incrementTitle: 'inkrementstitel', decrementTitle: 'minskningstitel' 
            } 
        } 
    }); 
    function loadCultureFiles(name) { 
        var files = ['currencies.json', 'numbers.json']; 
        var loader = ej.base.loadCldr; 
        var loadCulture = function (prop) { 
            var val, ajax; 
            ajax = new ej.base.Ajax('/node_modules/cldr-data/main/sv/' + files[prop], 'GET', false); 
            ajax.onSuccess = function (value) { 
                val = value; 
            }; 
            ajax.send(); 
            loader(JSON.parse(val)); 
        }; 
        for (var prop = 0; prop < files.length; prop++) { 
            loadCulture(prop); 
        } 
    } 
    //Load the needed culture files and set the culture for global 
    loadCultureFiles("sv"); 
    ej.base.setCulture('sv'); 
</script> 

If you follow this method, you don’t need to specify the culture at component level as like below. 

<ejs-numerictextbox id="numeric" value="12" decimals="2"></ejs-numerictextbox> 


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

Thanks, 
Christo

CONFIRMATION

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

;