New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Localization

The Scheduler provides options for localizing its user interface by utilizing the available Resource messages as well as providing custom messages as part of its configuration.

Getting Started

To use the community-sourced Resource files, override the executing context and set the server-side culture. This causes the ASP.NET MVC Scheduler to use the matching Resource file messages and localize them accordingly. In case of missing messages, you can update the Resource file or include the message in the configuration of the Scheduler.

  1. Add the Microsoft.AspNetCore.Mvc.Filters and System.Globalization to the controller by using the namespaces:

    using Microsoft.AspNetCore.Mvc.Filters;
    using System.Globalization;
    
  2. Override the default thread culture and the current UI culture.

    public override void OnActionExecuting(ActionExecutingContext context)
    {
        CultureInfo.DefaultThreadCurrentCulture = CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo("fr-FR");
    
        base.OnActionExecuting(context);
    }
    
  3. Match the client-side culture. Including the Kendo UI culture scripts, the number formats, the week and month names, the date and time formats, and so on will match the server-side culture and prevent validation errors. The culture scripts are generated by the Windows 10 and .NET 4.7 server-side culture definitions and match them by design.

    <script src="https://kendo.cdn.telerik.com/2024.1.319/js/cultures/kendo.culture.fr-FR.min.js">
    <!-- include the call to the kendo.culture() method before any widgets are initialized -->

    <script>kendo.culture("fr-FR");</script>

    @(Html.Kendo().Scheduler<TaskViewModel>()
        /* Scheduler definition */
    )

Common Messages

The following example demonstrates how to implement the message translation for the common messages within the Scheduler.

    .Messages(messages => messages
        .AllDay("Custom All Day Message")
        .Cancel("Custom Cancel Message")
        .Date("Custom Date Message")
        .DefaultRowText("Custom Default Row Text Message")
        .DeleteWindowTitle("Custom Delete Window Title Message")
        .Destroy("Custom Destroy Message")
        .Editable(editable => editable.Confirmation("Custom Confirmation Message"))
        .Event("Custom Event Message")
        .Next("Custom Next Message")
        .Pdf("Custom Pdf Message")
        .Previous("Custom Previous Message")
        .Refresh("Custom Refresh Message")
        .ResetSeries("Custom Reset Series Message")
        .Save("Custom Save Message")
        .Search("Custom Search Message")
        .SelectView("Custom Select View Message")
        .ShowFullDay("Custom Show Full Day Message")
        .ShowWorkDay("Custom Show Workd Day Message")
        .Time("Custom Time Message")
        .Today("Custom Today Message")
    )

Aria Messages

The following example demonstrates how to implement the message translation for the aria messages within the Scheduler.

    .Messages(messages => messages
        .AriaEventLabel("Custom Aria Event Label Message")
        .AriaSlotLabel("Custom Aria Slot Label Message")
    )

Recurrence Editor Messages

The following example demonstrates how to implement the message translation for the recurrence editor messages within the Scheduler.

    .Messages(messages => messages
        .RecurrenceEditor(recurrenceEditor => recurrenceEditor
            .End(end => end
                    .On("Custom On Message")
                    .Occurrence("Custom Occurrence Message")
                    .Label("Custom End Label Message")
                    .MobileLabel("Custom Mobile Label Message")
                    .Never("Custom Never Message")
                    .After("Custom After Message")
            )
            .Frequencies(frequencies => frequencies
                .Never("Custom Never Message")
                .Daily("Custom Daily Message")
                .Weekly("Custom Weekly Message")
                .Monthly("Custom Monthly Message")
                .Yearly("Custom Yearly Message")
            )
            .Daily(daily => daily
                  .Interval("Custom Interval Message")
                  .RepeatEvery("Custom Repeat Every Message")
            )
            .Weekly(weekly => weekly
                    .Interval("Custom Interval Message")
                    .RepeatOn("Custom Repeat On Message")
                    .RepeatEvery("Custom Repeat Every Message")
            )
            .Monthly(monthly => monthly
                    .Day("Custom Day Message")
                    .Interval("Custom Interval Message")
                    .RepeatOn("Custom Repeat On Message")
                    .RepeatEvery("Custom Repeat Every Message")
                    .Date("Custom Date Message")
            )
            .Yearly(yearly => yearly
                    .Day("Custom Day Message")
                    .Interval("Custom Interval Message")
                    .RepeatOn("Custom Repeat On Message")
                    .RepeatEvery("Custom Repeat Every Message")
                    .Of("Custom Of Message")
            )
            .OffsetPositions(offsetPositions => offsetPositions
                    .First("Custom First Message")
                    .Second("Custom Second Message")
                    .Third("Custom Third Message")
                    .Fourth("Custom Fourth Message")
            )
            .Cancel("Custom Cancel Message")
            .RecurrenceEditorTitle("Custom Recurrence Editor Title Message")
            .Update("Custom Update Message")
            .HeaderTitle("Custom Header Title Message")
            .EndTitle("Custom End Title Message")
            .RepeatTitle("Custom Repeat Title Message")
        )
    )

Recurrence Messages

The following example demonstrates how to implement the message translation for the recurrence messages within the Scheduler.

    .Messages(messages => messages
        .RecurrenceMessages(recurrenceMessages => recurrenceMessages
            .EditWindowTitle("Custom Edit Window Title Message")
            .EditWindowOccurrence("Custom Edit Window Occurrence Message")
            .DeleteWindowOccurrence("Custom Delete Window Occurrence Message")
            .ResetSeriesWindowTitle("Reset Series Window Title Message")
            .EditRecurring("Edit Recurring Message")
            .DeleteRecurring("Delete Recurring Message")
        )
    )

See Also

In this article