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

Setting up globalization in Schedule - ASP.NET Core

Thread ID:

Created:

Updated:

Platform:

Replies:

140429 Oct 17,2018 04:57 PM UTC Oct 19,2018 03:56 AM UTC ASP.NET Core - EJ 2 3
loading
Tags: Scheduler
Gregory Perozzo
Asked On October 17, 2018 04:59 PM UTC

Hello,

I'm following this tutorial for setting up globalization in the schedule component: https://ej2.syncfusion.com/aspnetcore/documentation/schedule/localization.html

When I run npm install cldr-data --save no folder was created in \scripts\cldr-data or /wwwroot/scripts/cldr-data. I only got a node_modules in the root of my project and inside of it I have a cldr-data folder.

So I created a script folder inside my project and copied the cldr-data folder to it.



When my page that have a Schedule component loads, the following error appears in the console. The Schedule appears normally, but without the translation I need.



And this is my script on the page:

        document.addEventListener('DOMContentLoaded', function () {
            var scheduleObject = document.getElementById('schedule').ej2_instances[0];
            var L10n = ej.base.L10n;
            L10n.load({
                "pt": {
                    "schedule": {
                        "day": "Dia",
                        "week": "Semana",
                        "workWeek": "Semana de trabalho",
                        "month": "Mês",
                    },
                }
            });
            loadCultureFiles('pt');
            scheduleObject.locale = 'pt';
        });

        function loadCultureFiles(name) {
            var files = ['ca-gregorian.json', 'numbers.json', 'timeZoneNames.json'];
            if (name === 'ar') {
                files.push('numberingSystems.json');
            }
            var loader = ej.base.loadCldr;
            var loadCulture = function (prop) {
                var val, ajax;
                ajax = new ej.base.Ajax(location.origin + '/../scripts/cldr-data/main/' + name + '/' + 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);
            }
        }

Any ideas what I am doing wrong?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On October 18, 2018 07:41 AM UTC

Hi Gregory, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your scenario by copy pasting the cldr-data folder outside the wwwroot and able to reproduce the reported issue. On inspecting, we found that not all the culture folders from /wwwroot/scripts/cldr-data are copied to \scripts\cldr-data which is the cause for the issue. Placing the scripts\cldr-data folder inside / outside the wwwroot will work and for the same we have prepared the below sample for your reference. 
 
Kindly ensure that /wwwroot/scripts/cldr-data and \scripts\cldr-data have same folders in your sample. 
 
Regards, 
Karthigeyan 


Gregory Perozzo
Replied On October 18, 2018 12:11 PM UTC

Karthigeyan,

Thank you very much for your help! I already did what you told on your example and my project now have globalization successfully configured.

You were very fast and right in your response.


Thank you again and have a nice day!


Karthigeyan Krishnamurthi [Syncfusion]
Replied On October 19, 2018 03:56 AM UTC

Hi Gregory, 
 
We are happy that our solution resolved your issue. 
 
Regards, 
Karthigeyan 


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

Live Chat Icon For mobile
Live Chat Icon