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 Core 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.
-
Add the
Microsoft.AspNetCore.Mvc.Filters
andSystem.Globalization
to the controller by using the namespaces:using Microsoft.AspNetCore.Mvc.Filters; using System.Globalization;
-
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); }
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.4.1112/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 */
)
<script src="https://kendo.cdn.telerik.com/2024.4.1112/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>
<kendo-scheduler name="scheduler">
/* Scheduler definition */
</kendo-scheduler>
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")
)
<messages all-day="Custom All Day Message"
cancel="Custom Cancel Message"
date="Custom Date Message"
default-row-text="Custom Default Row Message"
delete-window-title="Custom Delete Window Title Message"
destroy="Custom Destroy Message"
event="Custom Event Message"
next="Custom Next Message"
pdf="Custom Pdf Message"
previous="Custom Previous Message"
refresh="Custom Refresh Message"
reset-series="Custom Reset Series Message"
save="Custom Save Message"
search="Custom Search Message"
select-view="Custom Select View Message"
show-full-day="Custom Show Full Day Message"
show-work-day="Custom Show Work Day Message"
time="Custom Time Message"
today="Custom Today Message">
<editable confirmation="Custom Confirmation Message" />
</messages>
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")
)
<messages aria-event-label="Custom Aria Event Label Message"
aria-slot-label="Custom Aria Slot Label Message">
</messages>
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")
)
)
<messages>
<recurrence-editor cancel="Custom Cancel Message"
recurrence-editor-title="Custom Recurrence Editor Title Message"
update="Custom Update Message"
header-title="Custom Header Title Message"
end-title="Custom End Title Message"
repeat-title="Custom Repeat Title Message">
<end label="Custom End Label Message"
mobile-label="Custom Mobile Message"
never="Custom Never Message"
after="Custom After Message"/>
<frequencies never="Custom Never Message"
daily="Custom Daily Message"
weekly="Custom Weekly Message"
monthly="Custom Monthly Message"
yearly="Custom Yearly Message"/>
<daily interval="Custom Interval Message"
repeat-every="Custom Repeat Every Message" />
<weekly interval="Custom Interval Message"
repeat-on="Custom Repeat On Message"
repeat-every="Custom Repeat Every Message"/>
<monthly day="Custom Day Message"
interval="Custom Interval Message"
repeat-on="Custom Repeat On Message"
repeat-every="Custom Repeat Every Message"
date="Custom Date Message"/>
<yearly day="Custom Day Message"
interval="Custom Interval Message"
repeat-on="Custom Repeat On Message"
repeat-every="Custom Repeat Every Message"
of="Custom Of Message"/>
<offset-positions first="Custom First Message"
second="Custom Second Message"
third="Custom Third Message"
fourth="Custom Fourth Message"/>
</recurrence-editor>
</messages>
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")
)
)
<messages>
<recurrence-messages edit-window-title="Custom Edit Window Title Message"
edit-window-occurrence="Custom Edit Window Occurrence Message"
delete-window-occurrence="Custom Delete Window Occurrence Message"
reset-series-window-title="Reset Series Window Title Message"
delete-recurring="Delete Recurring Message"/>
</message>