Culture of RadScheduler disrespected

7 posts, 0 answers
  1. Ingemar
    Ingemar avatar
    17 posts
    Member since:
    Apr 2012

    Posted 01 Nov Link to this post

    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?

  2. Ingemar
    Ingemar avatar
    17 posts
    Member since:
    Apr 2012

    Posted 02 Nov Link to this post

    A link that describes the problem: http://www.telerik.com/forums/ui-culture-changes-back-after-some-time
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anton
    Admin
    Anton avatar
    61 posts

    Posted 02 Nov Link to this post

    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.
  5. Ingemar
    Ingemar avatar
    17 posts
    Member since:
    Apr 2012

    Posted 02 Nov in reply to Anton Link to this post

    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?)

     

  6. Ingemar
    Ingemar avatar
    17 posts
    Member since:
    Apr 2012

    Posted 02 Nov in reply to Ingemar Link to this post

    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?
  7. Ingemar
    Ingemar avatar
    17 posts
    Member since:
    Apr 2012

    Posted 02 Nov Link to this post

    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");
    }

     

  8. Anton
    Admin
    Anton avatar
    61 posts

    Posted 03 Nov Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017