Change start day of Calendar and language problem

Hi,

 It´s posible change the start day to Monday, by default appear in Sunday.
 I make all steps to change the language and it does not work.

            Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-ES");
            InitializeComponent();
            sfDateTimeEdit1.Culture = new CultureInfo("es-ES");
            InputLocalizationResource.SetResources(typeof(FormExpedienteContrato).Assembly, "SGGestion.Resources.Syncfusion.SfInput.WinForms");
            InputLocalizationResource.SetResources(typeof(FormExpedienteContrato).Assembly, "SGGestion.Resources.Syncfusion.SfListView.WinForms");




Thanks

7 Replies

AI Anirudhan Iyyappan Syncfusion Team April 2, 2020 09:28 AM UTC

Hi Ruben, 
 
Thank you for contacting Syncfusion support. 
 
Query 1: “It´s possible change the start day to Monday, by default appear in Sunday." 
 
We can change the start day of the week with the "FirstDayOfWeek" property from the MonthCalendar. For further references, please refer to the code snippet, sample and screenshot below. 
 
Code snippet: 
 
 
public Form1() 
        { 
            InitializeComponent(); 
            SfDateTimeEdit dateTimeEdit = new SfDateTimeEdit(); 
            this.Controls.Add(dateTimeEdit); 
            dateTimeEdit.MonthCalendar.FirstDayOfWeek = DayOfWeek.Monday; 
        } 
 
 
 
 
Query 2: “ I make all steps to change the language and it does not work." 
 
We can change the language by using the “Culture” Property. Please refer to the sample , screenshot and the UG Documentation below for further references. 
 
 
Screenshot: 
 
 
 
 
Regards, 
Anirudhan 



RU Ruben replied to Anirudhan Iyyappan April 2, 2020 10:57 AM UTC

Hi Ruben, 
 
Thank you for contacting Syncfusion support. 
 
Query 1: “It´s possible change the start day to Monday, by default appear in Sunday." 
 
We can change the start day of the week with the "FirstDayOfWeek" property from the MonthCalendar. For further references, please refer to the code snippet, sample and screenshot below. 
 
Code snippet: 
 
 
public Form1() 
        { 
            InitializeComponent(); 
            SfDateTimeEdit dateTimeEdit = new SfDateTimeEdit(); 
            this.Controls.Add(dateTimeEdit); 
            dateTimeEdit.MonthCalendar.FirstDayOfWeek = DayOfWeek.Monday; 
        } 
 
 
 
 
Query 2: “ I make all steps to change the language and it does not work." 
 
We can change the language by using the “Culture” Property. Please refer to the sample , screenshot and the UG Documentation below for further references. 
 
 
Screenshot: 
 
 
 
 
Regards, 
Anirudhan 


Hi, thanks for the reply
I have encountered the problem, for the button text, today and none.
In my form I have SfDateTimeEdit and SfListView, i have see the example in https://help.syncfusion.com/windowsforms/listview/localization and for one control in the form works fine, but with the two controls the translate don´t work.




AI Anirudhan Iyyappan Syncfusion Team April 3, 2020 04:09 PM UTC

Hi Ruben, 
 
Thank for the update. 
 
Based on your update, we've prepared a sample and we've met your requirements. Please refer to the sample below for further references 
 
 
Regards, 
Anirudhan 



RU Ruben April 6, 2020 10:00 AM UTC

Hello anirudhan

It works fine in the sample project, but it doesn't work in our project. We have tried everything and it does not go.
  I have also considered changing this
internal static global :: System.Resources.ResourceManager ResourceManager {
             get {
                 if (object.ReferenceEquals (resourceMan, null)) {
                     global :: System.Resources.ResourceManager temp = new global :: System.Resources.ResourceManager ("WindowsFormsApp1.Syncfusion.SfInput.WinForms", typeof (Syncfusion_SfInput_WinForms) .Assembly);
                     resourceMan = temp;
                 }
                 return resourceMan;
             }
         }

Our solution has multiple projects but the resources are in the main one, that's why I put this

InputLocalizationResource.SetResources(typeof(FormExpedienteContrato).Assembly, "SGGestion.Resources.Syncfusion.SfInput.WinForms");
            InputLocalizationResource.SetResources(typeof(FormExpedienteContrato).Assembly, "SGGestion.Resources.Syncfusion.SfListView.WinForms");

Thanks


BR Backia Raj Kanagaraj Syncfusion Team April 7, 2020 12:14 PM UTC

Hi Ruben, 

You can change the culture to entire application and control. Refer the below code and sample for your reference. 

Code snippet 
//Set the culture to application 
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES"); 
Thread.CurrentThread.CurrentUICulture = new CultureInfo("es-ES"); 

InitializeComponent(); 

//Initialization of SfDateTimeEdit 
SfDateTimeEdit dateTimeEdit = new SfDateTimeEdit(); 
this.Controls.Add(dateTimeEdit); 

//Set the first day of week 
dateTimeEdit.MonthCalendar.FirstDayOfWeek = DayOfWeek.Wednesday; 

//Set the culture to Datetime control 
dateTimeEdit.Culture = new CultureInfo("es-ES"); 


The below image contains the different set of first day of week. 

Output: 
 
 

Regards, 
Backia Raj Kanagaraj 



RU Ruben April 7, 2020 03:17 PM UTC

Hi Backia Raj Kanagaraj 

 Finally I have found the problem, in our project the name of the assembly and the namespace was different, putting it the same works perfectly for me.
Thank you very much and I feel the inconvenience





BR Backia Raj Kanagaraj Syncfusion Team April 8, 2020 07:05 AM UTC

Hi Ruben, 
 
Thanks for your update. 
  
We are glad to know that reported issue has been resolved. Please let us know if you have further queries. 
  
Regards, 
Backia Raj Kanagaraj 


Loader.
Up arrow icon