How to specify localization for DateTimeEditBox

Editors for WPF Forum

Posted 9 years ago by Yaron
Version: 15.1.0622
Avatar

Hi, here I need to make my DateTimeEditBox control localized, and not only follow the culture infomation of the current OS, but also need to specify a specific local culture (which is different from the OS culture) to the DateTimeEditBox control.  Is there any solution for it? thanks a lot.

Comments (7)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Yaron,

Our edit boxes should use whatever the CultureInfo.CurrentCulture of the app is set to.  You would need to alter that at app startup to affect how DateTimeEditBox presents its data.


Actipro Software Support

Posted 8 years ago by John Smith
Avatar

Hi,

I have the same problem. Where exactly I need to assign CurrentCulture? To which property? Hier is my code:

 

<editors:DateTimeEditBox Value="{Binding DateFrom}" HorizontalAlignment="Left" Margin="149,208,0,0" VerticalAlignment="Top" Width="180"/>

  Thanks in advance

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

The MSDN topic we link to in our reply above tells you how you can set the property.  You probably want to do it in code at app startup time.


Actipro Software Support

Posted 8 years ago by John Smith
Avatar

I have done that. My CurrentCulture is "de-DE". The names of months are correct, but the day names are still in english. How can i change that?

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

Do you mean that everything in the control now looks good (even when you zoom out to year view, etc.) except the day of the week headings (e.g. "Su", "Mo", etc.)?


Actipro Software Support

Posted 8 years ago by John Smith
Avatar

Hi,

 

that's right. The day of the week headings are still english and the field Today at the bottom of control is english too. Certainly the date/time format is correct.

[Modified 8 years ago]

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

The problem seems to be that the logic in our StringFormatConverter, DateTimeFormatPatternConverter, and DayOfWeekFormatPatternConverter value converters use the CultureInfo instance that is passed into them.  That seems to always be en-US, even when you change the thread's current culture.  We're updating all those for the next version (likely 2016.1) to use CultureInfo.CurrentCulture instead.  That gets the calendar itself fully rendering properly in your scenario.

The "Today" button text on the other hand is a string resource in our Editors assembly that you can alter as appropriate for other languages, since it only ships with English.  Please see our documentation on string resources for info on modifying them.


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.