New to Telerik UI for WinForms? Download free 30-day trial

Localizing Scheduler Navigator

The RadSchedulerNavigator control uses the SchedulerNavigatorLocalizationProvider class to define the default values for all strings that are displayed to the user.  You can easily override the default localization by inheriting from the SchedulerNavigatorLocalizationProvider class and override its GetLocalizedString method:

Custom Localization Provider

public class CustomSchedulerNavigatorLocalizationProvider : SchedulerNavigatorLocalizationProvider
{
    public override string GetLocalizedString(string id)
    {
        switch (id)
        {
            case SchedulerNavigatorStringId.DayViewButtonCaption:
                {
                    return "Day View";
                }
            case SchedulerNavigatorStringId.WeekViewButtonCaption:
                {
                    return "Week View";
                }
            case SchedulerNavigatorStringId.MonthViewButtonCaption:
                {
                    return "Month View";
                }
            case SchedulerNavigatorStringId.TimelineViewButtonCaption:
                {
                    return "Timeline View";
                }
            case SchedulerNavigatorStringId.AgendaViewButtonCaption:
                {
                    return "Agenda View";
                }
            case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption:
                {
                    return "Show Weekend";
                }
            case SchedulerNavigatorStringId.TodayButtonCaptionToday:
                {
                    return "Today";
                }
            case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek:
                {
                    return "This week";
                }
            case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth:
                {
                    return "This month";
                }
            case SchedulerNavigatorStringId.SearchInAppointments:
                {
                    return "Search In Appointments";
                }
        }
        return String.Empty;
    }
}

Public Class CustomSchedulerNavigatorLocalizationProvider
    Inherits SchedulerNavigatorLocalizationProvider
    Public Overrides Function GetLocalizedString(ByVal id As String) As String
        Select Case id
            Case SchedulerNavigatorStringId.DayViewButtonCaption
                Return "Day View"
            Case SchedulerNavigatorStringId.WeekViewButtonCaption
                Return "Week View"
            Case SchedulerNavigatorStringId.MonthViewButtonCaption
                Return "Month View"
            Case SchedulerNavigatorStringId.TimelineViewButtonCaption
                Return "Timeline View"
            Case SchedulerNavigatorStringId.AgendaViewButtonCaption
                Return "Agenda View"
            Case SchedulerNavigatorStringId.ShowWeekendCheckboxCaption
                Return "Show Weekend"
            Case SchedulerNavigatorStringId.TodayButtonCaptionToday
                Return "Today"
            Case SchedulerNavigatorStringId.TodayButtonCaptionThisWeek
                Return "This week"
            Case SchedulerNavigatorStringId.TodayButtonCaptionThisMonth
                Return "This month"
            Case SchedulerNavigatorStringId.SearchInAppointments
                Return "Search In Appointments"
        End Select
        Return String.Empty
    End Function
End Class

In order to utilize the new Localization Provider, you should create an instance of the new provider and assign it to the static CurrentProvider property of SchedulerNavigatorLocalizationProvider class:

Change the Current Provider

SchedulerNavigatorLocalizationProvider.CurrentProvider = new CustomSchedulerNavigatorLocalizationProvider();

SchedulerNavigatorLocalizationProvider.CurrentProvider = New CustomSchedulerNavigatorLocalizationProvider()

See Also

In this article