This is a migrated thread and some comments may be shown as answers.

Culture of RadScheduler disrespected

7 Answers 186 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Anders
Top achievements
Rank 1
Anders asked on 01 Nov 2016, 02:32 PM

When using WebServiceSettings in a RadScheduler, it seems like the Culture of the RadScheduler is overridden with one of the webservice.

In other words an explicit setting is overridden by a implicit, hidden (and possibly obscure) setting.

Many year old postings in this forum tells how to circumvent that madness, but none of them actually works.

The exact behavior is that a RadSchedulers Culture is respected until a response of the webservice containing appointments is received.

Then it is set to english, which is different from the culture I was setting.

Here is what I have tried

Adding

<globalization culture="sv-SE" uiCulture="sv-SE"/>

to web.config.

Setting the page declaration as

<%@ Page Language="C#" Culture="sv-SE" AutoEventWireup="true"

etc...

Running this:

RadScheduler1.Culture = CultureInfo.CurrentUICulture;
Page.Culture = RadScheduler1.Culture.ToString();

in Page_Load.

Is there a way to set Culture in RadScheduler and have it respected?

7 Answers, 1 is accepted

Sort by
0
Anders
Top achievements
Rank 1
answered on 02 Nov 2016, 07:31 AM
A link that describes the problem: http://www.telerik.com/forums/ui-culture-changes-back-after-some-time
0
Anton
Telerik team
answered on 02 Nov 2016, 07:34 AM
Hello Ingemar,

RadScheduler supports localization when using Web Service binding. However, some additional settings
are required. You already followed some of them.

The localization support for RadScheduler lets you completely translate the user interface, or simply adapt a few strings.In addition to the strings you can also customize the date and time format.

The primary means for localization in ASP.NET is to use resource files. Resource files are simple XML files that can be easily edited and transferred to other applications. You can use resource files to change the default (English) localization for RadScheduler that is stored in the Telerik.Web.UI assembly. You can find more information on that matter here.

I attached you a sample project where the scheduler is bound to a Web Service and with culture set to fr-FR. As you can see on the video, with the use of Global Resource Files the scheduler could be translated according to your needs.

Regards,
Anton
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Anders
Top achievements
Rank 1
answered on 02 Nov 2016, 09:21 AM

Hello Anton!

The zip files´ solution did not load ("the projects file or web cannot be found" in all four projects).

Theese are our observations this far:

Before the scheduler gets its appointments, Culture is respected and swedish strings will show up.

When the scheduler has got its appointments, it switches the display to english. (That will affect week numbers and date formats).

If we remove the WebService tag (thereby not populating the scheduler), the strings will not be changed from swedish.

The line:

console.log(Sys.CultureInfo.CurrentCulture)

 

always outputs an object where name = "en-US", regardless of when it is called (Sys will be undefined before the document is ready however).

If we create a folder App_GlobalResources and put the file Messages.sv-SE.resx there, nothing will change (will the presence of that file change Sys.CultureInfo.CurrentCulture anyway?)

 

0
Anders
Top achievements
Rank 1
answered on 02 Nov 2016, 09:23 AM
If I could edit my post, I would change "If we remove the WebService tag" to "If we remove the WebServiceSettings tag". Maybe the forum could be improved?
0
Anders
Top achievements
Rank 1
answered on 02 Nov 2016, 10:35 AM

I have circumvented the problem by setting the .NET version of the project to 4.6.1, adding a form runat="server"-tag around the RadScriptManager and in the code behind running the following:

if (!IsPostBack)
{
  CultureInfo.CurrentCulture = new CultureInfo("sv");
}

 

0
Anton
Telerik team
answered on 03 Nov 2016, 08:27 AM
Hello Ingemar,

Thank you for the provided solution to the issue.

Regards,
Anton
Telerik by Progress
Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
0
Anders
Top achievements
Rank 1
answered on 24 Apr 2018, 07:48 AM
Hello again! I did never get an explanation of RadSchedulers behavior. Only "thank you for the provided solution to the issue". Now we also got a case where tuesday was set as first day of week. Even if FirstDayOfWeek="Monday". I also expect the first day of week to be the one dictated by the Culture.
Tags
Scheduler
Asked by
Anders
Top achievements
Rank 1
Answers by
Anders
Top achievements
Rank 1
Anton
Telerik team
Share this question
or