KB Article A2769
Visible to All Users

Can I translate month and day names displayed in the DateEdit's calendar?

Description:
I'm using the DevExpress.XtraEditors.Controls.Localizer class to localize my editors. But I can't change month names in the date editor - I can only change the Today and Clear captions…

Answer:
Week and month names are taken from the system. They correspond to the current user locale. If you want your application to always be, for example, in Spanish, you can use the following code:

C#
[STAThread] static void Main() { Threading.Thread.CurrentThread.CurrentUICulture = new Globalization.CultureInfo("es-ES"); Application.Run(new Form1()); }
Visual Basic
' the main form's constructor Public Sub New() MyBase.New() Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("es-ES") 'This call is required by the Windows Form Designer. InitializeComponent() End Sub

See Also:
How to translate components via their Localizer objects
The collection of localized DevExpress assemblies

Comments (2)

    As far as I can see, the only way to set the dateedit's culture is to set the CurrentCulture to whatever I desire. My problem is that my CurrentCulture must stay as Invariant Culture and my CurrentUICulture set to whatever language user wants.
    Is there a way to avoid this behavior?.

    DevExpress Support Team 13 years ago

      You can use different Culture and UICulture in the same application. The CurrentUICulture property determines the control's interface (E.g. "Clear" button translation in the DateEdit control ). The CurrentCulture property determines system localization (E.g. month names, currency format ).
      Please refer to the following MSDN help topics for additional information:
      CultureInfo.CurrentCulture Property (System.Globalization)
      Thread.CurrentUICulture Property (System.Threading)

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.