The type 'CultureInfo' is defined in an assembly that is not referenced.

Hi,

I cannot set variable of Locale because an error 
"The type 'CultureInfo' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'."

My code is:
SfCalendar calendar = new SfCalendar();
calendar.Locale = new System.Globalization.CultureInfo("zh-CN");

My print screen in attach file.

Thank you so much.

Attachment: Screenshot_1_298a0a4c.zip

3 Replies 1 reply marked as answer

MS Muniappan Subramanian Syncfusion Team July 29, 2020 11:56 AM UTC

Hi Nguyen Ngoc Son, 
 
Thank you for contacting Syncfusion support. 
 
We have checked the reported issue “The type 'CultureInfo' is defined in an assembly that is not referenced “and it’s working fine from our end. We have prepared a simple sample for the same, please find the sample by the following link.  
 
 
Please refer the below UG documentation to more details about the localization support in calendar, 
 
We hope that this helps you, kindly revert us if you have any concern.  
 
Regards,   
Muniappan S. 


Marked as answer

PP Pooran Prasad Rajanna January 8, 2021 10:17 AM UTC

SfSchedule schedule;
        protected override void OnAttachedTo(ContentPage bindable)
        {
            base.OnAttachedTo(bindable);
            schedule = bindable.FindByName<SfSchedule>("schedule");
            //System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture(Settings.SelectedLocale);
            //this.monthCalendarAdv1.Culture = System.Globalization.CultureInfo.CurrentCulture;
            schedule.locale = new System.Globalization.CultureInfo(Settings.SelectedLocale.ToString()).ToString();
        }

locale just accepts string and not CultureInfo




SS SaiGanesh Sakthivel Syncfusion Team January 11, 2021 08:49 AM UTC

Hi Pooran, 
 
Thank you for contacting syncfusion support. 
 
#Regarding SfSchedule Locale does not accept CultureInfo. 
We would like to inform you that as per implementation of SfSchedule, locale is set by the specified locale strings value. Please refer to the following UG Documentation about ‘How to set the locale in SfSchedule’ for your reference. 
 
 
Please let us know if you have any concern. 
 
Regards, 
SaiGanesh Sakthivel 


Loader.
Up arrow icon