Bug: Thread culture setting is not respected

6 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Jan 2011 Link to this post

    The thread culture is not respected for the day names, time slots etc. See the attached screen shot (Swedish culture, day names appear in English). It works fine for the date/time pickers in the edit form though.
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 19 Jan 2011 Link to this post

    Hi Henrik,

    I was also expecting the Thread.CurrentCulture to be respected, but it seems that it isn't for all elements that rely on bindings to display culture dependent text. For example, the following does not work either:
    <TextBlock Text="{Binding AppointmentsSource[0].Start, ElementName=UserControl}"  Grid.Row="1"/>

    Where AppointmentsSource is a property of type ObservableAppointmentCollection in the UserControl (RadScheduleView.AppointmentsSource is bound to the same collection in my test app).

    I was able to change the format in the bindings using the xml:lang attribute, but it is not easy to change at runtime:
    <UserControl xml:lang="nl-nl" ... >

    As far as I know, this behavior is by design for the Silverlight runtime.

    The date pickers and the "current date" label in RadScheduleView work because the strings are formatted in the code-behind using the CurrentCulture as parameter.

    All the best,
    Valeri Hristov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 19 Jan 2011 Link to this post

    Ok. With all due respect, I don't think that is good enough. This has never been a problem with RadScheduler, and since RadScheduleView is meant to be a replacement for RadScheduler, I really think the new component has to do everything that the old one did, and hopefully better. Surely you cannot be planning to release an all-new version of a scheduling component that only works correctly in the US, especially when the old one was fully localizable? You say that "this is the default behaviour of Silverlight". That may be true, but in this case I think Silverlight is wrong.

    Also, I just checked the WPF demo, and that adapts fine to the Swedish culture setting. So the question is; is Silverlight or WPF "right"?

    Anyway, this has to be an easy fix. Just let the DateTime values go through a converter or something, and set the display format there according to the thread culture.

    Best regards,
    /Henrik
  5. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 20 Jan 2011 Link to this post

    I agree this is not good enough. We will update this functionality for the official release, but with the current state of the control, this is the best that you could do.

    Best wishes,
    Valeri Hristov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 20 Jan 2011 Link to this post

    Ok, I understand. That is fine. I got the impression you were not going to do anything about it. Sorry. :)
  7. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 20 Jan 2011 Link to this post

    No problem :)

    All the best,
    Valeri Hristov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner