- Home
- Forum
- ASP.NET Core - EJ 2
- Unable to localize to Hungarian
Unable to localize to Hungarian
I am trying to localize my ASP.NET Core project to Hungarian, currently it only contains a Scheduler component, which was working without localization:
<ejs-schedule id="schedule"
currentView="Month"
startHour="05:00"
endHour="20:00">
<e-schedule-eventsettings datasource="Model.Occasions"></e-schedule-eventsettings>
<e-schedule-views>
<e-schedule-view option="Week"></e-schedule-view>
<e-schedule-view option="Month"></e-schedule-view>
<e-schedule-view option="Agenda"></e-schedule-view>
</e-schedule-views>
</ejs-schedule>
I was following these instructions: https://ej2.syncfusion.com/aspnetcore/documentation/common/localization
Downloaded the hu.json file from https://github.com/syncfusion/ej2-locale/blob/master/src/hu.json, and placed it at wwwroot/locale.
Added it to the end of _Layout.cshtml body:
<script>
fetch('@Url.Content("~/locale/hu.json")')
.then(r => r.json())
.then(locale => {
ej.base.L10n.load(locale);
ej.base.setCulture('hu');
})
.catch(() => console.warn('Could not load Syncfusion locale'));
</script>
<!-- Syncfusion ASP.NET Core Script Manager -->
<ejs-scripts></ejs-scripts>
Now the component just keeps loading:
In Console, I see the following exception: ej2.min.js:10 Uncaught TypeError: Cannot convert undefined or null to object
Chrome locates it here:
_Ue.prototype.getDayNames = function(e) {
for (var t = [], i = Ue(this.locale) || "en" === this.locale || "en-US" === this.locale ? R("days.stand-alone." + e, Ti(this.getCalendarMode())) : R("main." + this.locale + ".dates.calendars." + this.getCalendarMode() + ".days.format." + e, Bi), n = 0, o = Object.keys(i); n < o.length; n++) {
var r = o[n];
t.push(R(r, i))
}
return t
}It makes sense, as in hu.json, there is no dates section at all for anything like main.hu.dates.calendars.gregorian.days.format.wide.
What am I doing wrong?
Hi Péter Szkupien,
/cldr-data/supplemental/numberingSystems.json /cldr-data/supplemental/weekData.json /cldr-data/supplemental/currencyData.json /cldr-data/main/hu/ca-gregorian.json /cldr-data/main/hu/numbers.json /cldr-data/main/hu/timeZoneNames.json |
<script> function getJSON(path) { return fetch(path).then(r => r.json()); } // Load CLDR files required by EJ2 (dates, numbers, time zones, supplemental) Promise.all([ getJSON('@Url.Content("~/cldr-data/supplemental/numberingSystems.json")'), getJSON('@Url.Content("~/cldr-data/main/hu/ca-gregorian.json")'), getJSON('@Url.Content("~/cldr-data/main/hu/numbers.json")'), getJSON('@Url.Content("~/cldr-data/main/hu/timeZoneNames.json")'), getJSON('@Url.Content("~/cldr-data/supplemental/weekData.json")'), getJSON('@Url.Content("~/cldr-data/supplemental/currencyData.json")') ]).then(function (cldrData) { ej.base.loadCldr.apply(this, cldrData); // Load Syncfusion localized component strings return getJSON('@Url.Content("~/locale/hu.json")'); }).then(function (locale) { ej.base.L10n.load(locale); ej.base.setCulture('hu'); }).catch(function (e) { console.warn('Localization/CLDR loading failed', e); }); </script> |
Documentation: Localization in ASP.NET CORE Schedule Control | Syncfusion
Regards,
Vijayakumar R
Attachment: Localle_Core_c319e94d.zip
- 1 Reply
- 2 Participants
- Marked answer
-
PS Péter Szkupien
- Feb 15, 2026 10:31 AM UTC
- Feb 16, 2026 05:14 PM UTC