
10 Answers, 1 is accepted

Check the following code library which explains the same.
Local resources for RadGrid, RadCalendar and RadInput
-Shinu.

We tried the examples given in the Telerik site for RadCalendar and implemented Localization for the same successfully. But, it works only for the Culture \ CultureInfo properties (like "en-US", "fr-FR") for both RadScheduler and RadCalendar. But, in our application we are using only "CurrentUICulture", which has the value of only neutral culture (like en, fr etc ...) . When this is assigned to the RadCalendar, we are getting the following error:
Message: Culture 'fr' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.
Stack trace:
at System.Globalization.
at System.Globalization.
at Telerik.Web.UI.Scheduler.
at Telerik.Web.UI.Scheduler.
at Telerik.Web.UI.RadScheduler.
at Telerik.Web.UI.RadScheduler.
at System.Web.UI.Control.
at System.Web.UI.Control.
at Telerik.Web.
at Telerik.Web.
at Telerik.Web.
at Telerik.Web.UI.RadAjaxControl.
at System.EventHandler.Invoke(
at System.Web.UI.Control.
at System.Web.UI.Control.
at System.Web.UI.Page.
But, as per the information given in the link below, the 'CultureInfo' property should also support the two letter ISO Language names like "en" or "fr" etc ..
http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radcalendar_cultureinfo.html
Can you please let us know a solution for this ? How can we assign the 'CurrentUICulture' (TwoLetterISOLanguage Name) value to the 'RadCalendar' control, which has only the 'CultureInfo' property ?
Thanks & Regards,
Karthik.
The problem is that a Thread's culture can not be neutral. It must be specific like en-US or fr-FR. For more information on the matter you can refer to the link below:
http://www.socalmp.com/blog/template_permalink.asp?id=98
Kind regards,
Pavlina
the Telerik team
Additionally, you can try using CultureInfo.CreateSpecificCulture method, which accepts neutral culture and see if it helps. This method maps a neutral culture to the associated default specific culture, and then creates a CultureInfo object that represents that specific culture. Please refer to the msdn link below for additional information:
http://msdn.microsoft.com/en-us/library/se513yha.aspx
All the best,
Pavlina
the Telerik team

I have found the same problem.. I have been setting the current thread's CurrentUICulture to a neutral culture and NOT setting the thread's CurrentCulture (leaving it as the default which for me is en-US) and it seems that the RadScheduler is ignoring what the CurrentCulture CultureInfo is and just forcing the CurrentUICulture over the top of it?! This doesn't seem right!!
A possible solution is to use the CultureInfo.CreateSpecificCulture function as you suggest and set it to the CurrentUICulture but this potentially will cause problems if there are multiple translations for different variants of the neutral culture and clobber the neutral translations.
Is there a reason that the RadScheduler is forcing the CurrentUICulture over the top of the CurrentCulture setting?
Thanks,
Andrew
You could experience such problem with RadScheduler if you use Web Service binding. In this case, please follow the suggestion from this help topic.
All the best,
Peter
the Telerik team

Unfortunately this is not the case. I am just using a regular datasource for binding.
To demonstrate this problem something like this should do it:
protected override void InitializeCulture()
{
base.InitializeCulture();
Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr");
}
Note that it does not set the CurrentCulture property however the RadScheduler will complain that "fr" is not a specific culture (which is perfectly fine for setting the UI culture but not the thread culture.
Cheers,
Andrew
I tested your code, but it didn't give any problems - http://screencast.com/t/WMTYHb0IGjw. Please, let me know if I am missing something.
All the best,
Peter
the Telerik team

A couple of things..
I've looked at your video but was a little confused. You set the CurrentUICulture although given you don't have the french translation for the scheduler in your project the strings aren't localised. However, as you point out in the video, the dates etc ARE localised. This suggests that you are setting the CurrentCulture somewhere else (and setting it to a french specific culture such as fr-FR) OR maybe you've got your computer's locale set to fr-FR or similar.
Also, you appear to be changing the CurrentUICulture in the Page_Load which I believe is incorrect. Should it not be done in the InitializeCulture?
In any case, I relooked at this on my end by modifying one of the example scheduler projects but was not able to reproduce the problem. What confuses me is that if I were to try set the CurrentCulture to a non-specific culture it would throw an exception there and then, not wait until it was in the bowels of the Scheduler create code (as per the stack trace from the exception I am getting):
[NotSupportedException: Culture 'fr' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.]
System.Globalization.CultureInfo.CheckNeutral(CultureInfo culture) +7484386
System.Globalization.CultureInfo.get_DateTimeFormat() +28
System.Globalization.DateTimeFormatInfo.GetInstance(IFormatProvider provider) +87
System.DateTime.ToString(String format, IFormatProvider provider) +23
Telerik.Web.UI.Scheduler.Views.Month.RendererBase.CreateNavigationPane(Control container) +158
Telerik.Web.UI.Scheduler.Views.Month.Renderer.GetContent() +88
Telerik.Web.UI.RadScheduler.CreateContent() +218
Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +195
Telerik.Web.UI.RadScheduler.CreateChildControls() +34
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
From the call stack, it suggests that there is a call to DateTime.ToString(string, IFormatProvider) in Telerik.Web.UI.Scheduler.Views.Month.RendererBase.CreateNavigationPane that is using the Thread.CurrentThread.CurrentUICulture instead of the CurrentCulture?
I will continue to try and distinguish the difference between my project and the modified sample and let you know if I find anything.
Cheers,
Andrew
Thank you for sharing your findings.
Setting the Culture property of RadScheduler or the current thread culture will localize only some strings on RadScheduler. For the rest of them you should use the approach outlined in this help topic -
http://www.telerik.com/help/aspnet-ajax/scheduler-localization-translating-strings.html
Regards,
Peter
the Telerik team