In my application, I have an UltraTabControl with 3 tabs: an UltraDayView, an UltraMonthViewSingle and an UltreTimeLineView. They all use a common UltraCalendarInfo object. In this object, I modified the days of the week and months of the year names to have them in french. It works fine with the UltraDayView and the UltraMonthViewSingle controls, but the UltraTimeLineView seems to ignore them although other UltraCalendarInfo elements are taken into account as expected. Is there a special setting I have to do to make it work? If not, is there a way around?
I am working with the UltraTimeLineView of the WinForms library v14.2.
The easiest way to make all the week day and month names to show in French, or any other language, is to set the CurentCulture and CurentUICulture of your application to French CultureInfo. To do so add these two rows in the very beginning of your application’s Main method:
Thread.CurrentThread.CurrentCulture = new CultureInfo("fr-FR");Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR");
You may check this article in MSDN for additional information “How to: Set the Culture and UI Culture for Windows Forms Globalization”. I am not sure what you have changed in your UltraCalendarInfo, but this should be enough to force your application to show each localizable string in French.
If you need to change the way strings are shown in UltraTimeLineView header you may set HeaderTextFormat like this:
this.ultraTimelineView1.PrimaryInterval.HeaderTextFormat = "dddd, MMMM d, yyyy";
Attached is a small sample project showing how to localize you application.
Please check my sample and let me know if you have any additional questions.
Thank you for the suggestion. This application is large and complex. I am extremely reluctent to systematically change the culture for the whole application. Based on what you told me, here is what I did:
This works but is no silver bullet as the window is not modal and could be opened while the user works with other windows, but it is the best I could come up with. Do you have any other suggestion?
Thank you for the prompt answer
Reading back to your first post, how were you changing the days of week and other strings without changing the culture?
In the CalendarInfo, there are properties called "DaysOfWeek" and "MonthsOfYear". These properties allow us to change the names for days and months. When I associate the CalendarInfo with an UltraDayView or a UltraMonthViewSingle thay are taken into account just fine. Not so with the UltraTimeLineView which seems to completely ignore them.
This seems to me like an inconsistency.
I have investigated this further and you are correct. There is inconsistency in UltraSchedule controls. While UltraDayView and UltraMonthViewSingle consider the LongDescription and ShortDescription of DaysOfWeek and MonthsOfYear as you set them in UltraCalendarInfo, UltraTimeLineView does not take into account these settings. I have asked our engineering staff to examine this further. To ensure that it will receive attention, I have logged this behavior in our internal tracking system with a Development ID of #226081. So I’ve created a case for you CAS-177286-M9Y0X3 and will update you for the progress of this issue via the mentioned case. You could reach your case following the link below:
In the mean time you may try to set / reset the UI culture in Activated / Deactivate events of your form. However, I do not know what your application logic is, so cannot tell you where is the best place to set / reset the UI culture is.