SchedulerNavigatorLocalization

2 Answers 69 Views
Scheduler and Reminder
ebrahim
Top achievements
Rank 1
Iron
Iron
ebrahim asked on 30 Dec 2021, 01:01 PM

hi

my class localization is


 public class CustomSchedulerNavigatorLocalizationProvider : SchedulerNavigatorLocalizationProvider
    {
        public override string GetLocalizedString(string id)
        {
            switch (id)
            {
                case SchedulerNavigatorStringId.AgendaViewButtonCaption:
                    {
                        return "دستور کار";
                    }
                case SchedulerNavigatorStringId.DayViewButtonCaption:
                    {
                        return "روزانه";
                    }
                case SchedulerNavigatorStringId.WeekViewButtonCaption:
                    {
                        return "هفتگی";
                    }
                case SchedulerNavigatorStringId.MonthViewButtonCaption:
                    {
                        return "ماهانه";
                    }
                case SchedulerNavigatorStringId.TimelineViewButtonCaption:
                    {
                        return "تایم لاین";
                    }
                case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption:
                    {
                        return "تعطیلات هفته";
                    }
                case SchedulerNavigatorStringId.TodayButtonCaptionToday:
                    {
                        return "امروز";
                    }
                case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek:
                    {
                        return "این هفته";
                    }
                case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth:
                    {
                        return "این ماه";
                    }
                case SchedulerNavigatorStringId.SearchInAppointments:
                    {
                        return "جستجو ";
                    }
            }
            return String.Empty;
        }
    }

but agenda view not translat!!!

2-Can I write code for today's event?

MrBizzl
Top achievements
Rank 2
Iron
commented on 30 Dec 2021, 01:32 PM | edited

Hello Ebrahim

Try this code in your Main Class to switch current Provider

SchedulerNavigatorLocalizationProvider.CurrentProvider = new CustomSchedulerNavigatorLocalizationProvider();

More infos here:

Localizing RadScheduler - WinForms Scheduler Control | Telerik UI for WinForms

Yours

Timo

ebrahim
Top achievements
Rank 1
Iron
Iron
commented on 30 Dec 2021, 01:42 PM

please see atache image

only agenda not translat

2 Answers, 1 is accepted

Sort by
0
MrBizzl
Top achievements
Rank 2
Iron
answered on 30 Dec 2021, 04:02 PM | edited on 30 Dec 2021, 04:07 PM

HI Ebrahim

Try to place CurrentProvider property before  InitializeComponent() like shown below:
Public Class RadForm1
    Sub New()
        SchedulerNavigatorLocalizationProvider.CurrentProvider = New CustomSchedulerNavigatorLocalizationProvider();
        InitializeComponent();
    End Sub
End Class

Hope it works.

Yours
Timo

ebrahim
Top achievements
Rank 1
Iron
Iron
commented on 31 Dec 2021, 07:57 PM

hi

Thanks it was done this way

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Dec 2021, 10:38 AM
Hello, Ebrahim,

According to the provided information, it is not clear where exactly the custom SchedulerNavigatorLocalizationProvider is applied. However, please have in mind that it is very important to be applied before the InitializeComponent method:
        public RadForm1()
        {
            SchedulerNavigatorLocalizationProvider.CurrentProvider = new CustomSchedulerNavigatorLocalizationProvider();
            InitializeComponent();
        }

        public class CustomSchedulerNavigatorLocalizationProvider : SchedulerNavigatorLocalizationProvider
        {
            public override string GetLocalizedString(string id)
            {
                switch (id)
                {
                    case SchedulerNavigatorStringId.AgendaViewButtonCaption:
                        {
                            return "دستور کار";
                        }
                    case SchedulerNavigatorStringId.DayViewButtonCaption:
                        {
                            return "روزانه";
                        }
                    case SchedulerNavigatorStringId.WeekViewButtonCaption:
                        {
                            return "هفتگی";
                        }
                    case SchedulerNavigatorStringId.MonthViewButtonCaption:
                        {
                            return "ماهانه";
                        }
                    case SchedulerNavigatorStringId.TimelineViewButtonCaption:
                        {
                            return "تایم لاین";
                        }
                    case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption:
                        {
                            return "تعطیلات هفته";
                        }
                    case SchedulerNavigatorStringId.TodayButtonCaptionToday:
                        {
                            return "امروز";
                        }
                    case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek:
                        {
                            return "این هفته";
                        }
                    case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth:
                        {
                            return "این ماه";
                        }
                    case SchedulerNavigatorStringId.SearchInAppointments:
                        {
                            return "جستجو ";
                        }
                }
                return String.Empty;
            }
        }

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
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/.

Tags
Scheduler and Reminder
Asked by
ebrahim
Top achievements
Rank 1
Iron
Iron
Answers by
MrBizzl
Top achievements
Rank 2
Iron
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or