In languages with noun declension like czech correct form is "leden 2022", displayed is "ledna 2022"
3 comments
ADMIN
Didi
Posted on:24 Jan 2022 08:26
Hi Jiri,
Thank your for this update.
Regarding the native workaround I suggested, it is different from the code you have provided.
String result = calendar.GetDisplayName((int)Java.Util.CalendarField.Month, Java.Util.Calendar.LongStandalone, new Java.Util.Locale("cs"));
calendarCell.Text = result;
I have used the GetDisplayName and set the locale in it, and also the LongStandalone usage of the calendar. Then the January was translated to leden.
var ci = new CultureInfo("cs"); var netDate = new System.DateTime(2022, 1, 1); var s = netDate.ToString("MMMM yyyy", ci); //correct leden 2022
var locale = new Java.Util.Locale("cs"); var calendar = Java.Util.Calendar.GetInstance(locale); calendar.Set(2022, 0, 1); Java.Text.DateFormat dateFormat = new SimpleDateFormat("MMMM yyyy", locale); s = dateFormat.Format(calendar.Time); //wrong ledna 2022
ADMIN
Didi
Posted on:21 Jan 2022 13:15
Hi Jiri,
Thank you for the provided information. We do not translate the month/day names. We use the locale to get the names of the days, months, etc. and display them in the calendar. This is not an issue in the Telerik UI for Xamarin Calendar control.
However, I have changed the item to a feature request, as we can think about providing a property to manually set the formatter.
For now the solution for iOS and Android is through a custom renderer. I have attached the files for the Android and iOS renderers. Using a custom formatter, the January in Czech is translated to "leden".
Regards,
Didi
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.