CultureNotFoundException

If we set up an Android mobile, with es-ES culture. In SfSchedule version 16.2.0.42. And we associate local to that of the system. 

sfSchedule.Locale = base.Resources.Configuration.Locale;

The exception is thrown.

System.Globalization.CultureNotFoundException: Culture name es_ES is not supported.
Parameter name: name
  at System.Globalization.CultureInfo.CreateSpecificCulture (System.String name) [0x0006e] in :0
  at Com.Syncfusion.Schedule.DateTimeExtensions.GetDayMonthYearValue (Java.Util.Calendar dateCalendar, Com.Syncfusion.Schedule.SfSchedule schedule) [0x00057] in <22c71d13bf074aa690e3a04792f01925>:0
  at Com.Syncfusion.Schedule.ViewHeaderLayout.UpdateCellValues (Com.Syncfusion.Schedule.ViewHeaderCell viewHeaderCell, Java.Util.Calendar calendar, Com.Syncfusion.Schedule.SfSchedule schedule) [0x0002d] in <22c71d13bf074aa690e3a04792f01925>:0
  at Com.Syncfusion.Schedule.ViewHeaderLayout.CreateHeaderCell (Com.Syncfusion.Schedule.SfSchedule schedule, Java.Util.Calendar calendar) [0x0000c] in <22c71d13bf074aa690e3a04792f01925>:0
  at Com.Syncfusion.Schedule.ViewHeaderLayout.OnMeasure (System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00031] in <22c71d13bf074aa690e3a04792f01925>:0
  at Android.Views.View.n_OnMeasure_II (System.IntPtr jnienv, System.IntPtr native__this, System.Int32 widthMeasureSpec, System.Int32 heightMeasureSpec) [0x00008] in <263adecfa58f4c449f1ff56156d886fd>:0
  at (wrapper dynamic-method) System.Object.44f67f54-5542-4f71-833d-e591c8f9e15d(intptr,intptr,int,int)



1 Reply

VR Vigneshkumar Ramasamy Syncfusion Team July 2, 2018 12:54 PM UTC

Hi Andrés   
  
Thanks for your interest in Syncfusion products.   
    
While using the base.Resources.Configuration.Locale, it returns the locale with (Example: es_ES) format, we have support for culture information based on RFC 4646 and BCP-47 for languages code which is the common standard for language codes. 
So, we suggest you to use the ToLanguageTag() method to convert the locale to the BCP-47 standard. 
Please refer the below code example.   
   
Code snippet:   
Schedule.Locale = new Locale(base.Resources.Configuration.Locale.ToLanguageTag());   
   
Please refer the below links for more information:   
    
Please revert us if you have any concern.   
  
Regards  
Vigneshkumar R  


Loader.
Up arrow icon