Scheduler not showing correct localization of month and year

0 Answers 58 Views
Scheduler
Matt Smith
Top achievements
Rank 1
Matt Smith asked on 02 Jul 2021, 10:42 PM

Is there a way to properly set the localization culture for the month and year with month header when it is showing the month and date?

I have set the culture property and the days of the week are showing the correct localization based on the culture settings however the header is not

Attached is a screw grab showing the issue. The month and year should actually be Ago 2021 (localization is for it-IT)

Peter Milchev
Telerik team
commented on 07 Jul 2021, 11:41 AM

Hi Matt, can you please edit your question and include the setup of the page and the Scheduler? A simple Scheduler with Culture="it-IT" will show the date in Italian as expected, without the need for any resource files as the text comes from the CultureInfo itself.
Matt Smith
Top achievements
Rank 1
commented on 07 Jul 2021, 02:50 PM

I understand that the month and year should be handled by the control as most of the controls when you set the culture info seamlessly do that and the other text in the scheduler is converted to the correct culture. However, in this case it is not and that is what I am trying to figure out.

This is definition for the control

<TELERIK:RADSCHEDULER RENDERMODE="Lightweight" RUNAT="server" ID="RadScheduler1" SKIN="Windows7" HEIGHT="800" CSSCLASS="edr"
ONCLIENTNAVIGATIONCOMPLETE="OnClientNavigationComplete"
SELECTEDVIEW="MonthView" SHOWFOOTER="false"
OVERFLOWBEHAVIOR="Expand"
ENABLEDESCRIPTIONFIELD="false" APPOINTMENTSTYLEMODE="Default" ENABLERECURRENCESUPPORT="false" TIMEZONEOFFSET="00:00:00">
<MONTHVIEW VISIBLEAPPOINTMENTSPERDAY="6" />
<WEBSERVICESETTINGS PATH="~/ws/sws.asmx" RESOURCEPOPULATIONMODE="ServerSide" />
<ADVANCEDFORM MODAL="true" />
<TIMELINEVIEW USERSELECTABLE="false" />
<DAYVIEW USERSELECTABLE="false" />
<MONTHVIEW USERSELECTABLE="false" />
<DAYVIEW USERSELECTABLE="false" />
<WEEKVIEW USERSELECTABLE="false" />
<RESOURCESTYLES>
<TELERIK:RESOURCESTYLEMAPPING TYPE="Pgm1" TEXT="SR" APPLYCSSCLASS="rsCategoryRed" />
<TELERIK:RESOURCESTYLEMAPPING TYPE="Pgm2" TEXT="DR" APPLYCSSCLASS="rsCategoryBlue" />
<TELERIK:RESOURCESTYLEMAPPING TYPE="Evt" TEXT="Evt" APPLYCSSCLASS="rsCategoryOrange" />
<TELERIK:RESOURCESTYLEMAPPING TYPE="TC" TEXT="TC" APPLYCSSCLASS="rsCategoryGreen" />
<TELERIK:RESOURCESTYLEMAPPING TYPE="Calendar" TEXT="Vehicles" BACKCOLOR="#edd5b7" BORDERCOLOR="#cdb597" />
</RESOURCESTYLES>
<TIMESLOTCONTEXTMENUSETTINGS ENABLEDEFAULT="false" />
<APPOINTMENTCONTEXTMENUSETTINGS ENABLEDEFAULT="false" />
</TELERIK:RADSCHEDULER>
Peter Milchev
Telerik team
commented on 12 Jul 2021, 02:30 PM

When the Scheduler is using WebService binding, it has a client-side rendering logic. The date formats in this case are relying on the Sys.CultureInfo.CurrentCulture that comes from the MSAJAX framework itself. In this case, the culture remains en-US instead of it-IT. https://docs.microsoft.com/en-us/archive/msdn-magazine/2007/december/cutting-edge-inside-the-microsoft-ajax-library 
Matt Smith
Top achievements
Rank 1
commented on 12 Jul 2021, 03:17 PM

Peter, thanks for the insight. So how do you get around this? The control itself doesn't render out into something that is easily changed. In fact that is custom control you have created which I don't think has a defined API so I don't think there is a way to hook into it.

So how do you change various items? This appears to be half baked because somethings are correct and other things stay in English.
Peter Milchev
Telerik team
commented on 13 Jul 2021, 11:19 AM

Matt, I understand that from your point of view the control looks "half baked" and that is perfectly logical from a user perspective.

Unfortunately, that is how any control would behave when it renders the data dynamically on the client-side, i.e. relies on the framework's culture info. The translated parts you see are messages that are supported and set by the localization and they are working fine. 

On the other hand, the date format is culture-specific and cannot be easily localized, especially with the .resx files. That is why usually the numbers format and date format are retrieved by the culture. As you have seen, the MS AJAX framework sends only the en-US specific data to the client, hence the date is expected to be in English when the CurrentCulture is en-US. 

I will research further this and see if there is any way to overcome this framework behavior without needing to overwrite a lot of control/framework private functionality.

Matt Smith
Top achievements
Rank 1
commented on 13 Jul 2021, 11:30 AM

Peter, that makes no sense whatsoever from the programmatic viewpoint. Why are the day headings correct yet the controls that are used to select views wrong? I set the culture value on the server side as it is controlled by my app through a language selection and not on the control itself.

The DateTime picker works just fine. Everything is rendered according to the culture info. Yet, here the one area is totally wrong, that of the navigation/message bar above the day headings. This has really got nothing to do with MS AJAX. It is a one time shot when the control is initialized. The screen grab shows this very succinctly. If I was manipulating the language settings this from the client side, yes, your arguments would make sense.

Is this just the behavior of the web service or is it for all data connection types period?

No answers yet. Maybe you can help?

Tags
Scheduler
Asked by
Matt Smith
Top achievements
Rank 1
Share this question
or