Localizing Reminder Strings
To localize RadReminder to display control text and messages in a specific language:
Start by creating a descendant of the RadReminderLocalizationProvider class.
Override the GetLocalizedString(string id) method and provide a translation for the label and user messages. If a translation is not provided, the default value will be returned. This behavior is guaranteed by the call to the base GetLocalizedString method in the default clause of the switch statement in the example.
Below is a sample implementation of an English localization provider:
Sample English Localization Provider
public class EnglishReminderLocalizationProvider : RadReminderLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case RadReminderStringId.AlarmFormButtonDismiss:
return "Dismiss";
case RadReminderStringId.AlarmFormButtonDismissAll:
return "Dismiss All";
case RadReminderStringId.AlarmFormButtonOpenItem:
return "Open Item";
case RadReminderStringId.AlarmFormButtonSnooze:
return "Snooze";
case RadReminderStringId.AlarmFormColumnDueIn:
return "Due in";
case RadReminderStringId.AlarmFormColumnSubject:
return "Subject";
case RadReminderStringId.AlarmFormLabelSnooze:
return "Click Snooze to be reminded again in:";
case RadReminderStringId.AlarmFormReminder:
return "Reminder";
case RadReminderStringId.AlarmFormReminders:
return "Reminders";
case RadReminderStringId.AlarmFormSnoozeOneMinute:
return "1 minute";
case RadReminderStringId.AlarmFormSnoozeFiveMinutes:
return "5 minutes";
case RadReminderStringId.AlarmFormSnoozeTenMinutes:
return "10 minutes";
case RadReminderStringId.AlarmFormSnoozeFifteenMinutes:
return "15 minutes";
case RadReminderStringId.AlarmFormSnoozeThirtyMinutes:
return "30 minutes";
case RadReminderStringId.AlarmFormSnoozeOneHour:
return "1 hour";
case RadReminderStringId.AlarmFormSnoozeTwoHours:
return "2 hours";
case RadReminderStringId.AlarmFormSnoozeFourHours:
return "4 hours";
case RadReminderStringId.AlarmFormSnoozeEightHours:
return "8 hours";
case RadReminderStringId.AlarmFormSnoozeHalfDay:
return "0.5 days";
case RadReminderStringId.AlarmFormSnoozeOneDay:
return "1 day";
case RadReminderStringId.AlarmFormSnoozeTwoDays:
return "2 days";
case RadReminderStringId.AlarmFormSnoozeThreeDays:
return "3 days";
case RadReminderStringId.AlarmFormSnoozeFourDays:
return "4 days";
case RadReminderStringId.AlarmFormSnoozeOneWeek:
return "1 week";
case RadReminderStringId.AlarmFormSnoozeTwoWeeks:
return "2 weeks";
case RadReminderStringId.DueInMinute:
return "minute";
case RadReminderStringId.DueInMinutes:
return "minutes";
case RadReminderStringId.DueInHour:
return "hour";
case RadReminderStringId.DueInHours:
return "hours";
case RadReminderStringId.DueInDay:
return "day";
case RadReminderStringId.DueInDays:
return "days";
case RadReminderStringId.DueInWeek:
return "week";
case RadReminderStringId.DueInWeeks:
return "weeks";
case RadReminderStringId.DueInNow:
return "now";
case RadReminderStringId.DueInOverdue:
return "{0} overdue";
case RadReminderStringId.AlarmFormSelectMoreRemindObjects:
return " reminders are selected.";
}
return string.Empty;
}
}
Public Class EnglishReminderLocalizationProvider
Inherits RadReminderLocalizationProvider
Public Overrides Function GetLocalizedString(ByVal id As String) As String
Select Case id
Case RadReminderStringId.AlarmFormButtonDismiss
Return "Dismiss"
Case RadReminderStringId.AlarmFormButtonDismissAll
Return "Dismiss All"
Case RadReminderStringId.AlarmFormButtonOpenItem
Return "Open Item"
Case RadReminderStringId.AlarmFormButtonSnooze
Return "Snooze"
Case RadReminderStringId.AlarmFormColumnDueIn
Return "Due in"
Case RadReminderStringId.AlarmFormColumnSubject
Return "Subject"
Case RadReminderStringId.AlarmFormLabelSnooze
Return "Click Snooze to be reminded again in:"
Case RadReminderStringId.AlarmFormReminder
Return "Reminder"
Case RadReminderStringId.AlarmFormReminders
Return "Reminders"
Case RadReminderStringId.AlarmFormSnoozeEightHours
Return "8 hours"
Case RadReminderStringId.AlarmFormSnoozeFifteenMinutes
Return "15 minutes"
Case RadReminderStringId.AlarmFormSnoozeFiveMinutes
Return "5 minutes"
Case RadReminderStringId.AlarmFormSnoozeFourDays
Return "4 days"
Case RadReminderStringId.AlarmFormSnoozeFourHours
Return "4 hours"
Case RadReminderStringId.AlarmFormSnoozeHalfDay
Return "0.5 days"
Case RadReminderStringId.AlarmFormSnoozeOneDay
Return "1 day"
Case RadReminderStringId.AlarmFormSnoozeOneHour
Return "1 hour"
Case RadReminderStringId.AlarmFormSnoozeOneMinute
Return "1 minute"
Case RadReminderStringId.AlarmFormSnoozeOneWeek
Return "1 week"
Case RadReminderStringId.AlarmFormSnoozeTenMinutes
Return "10 minutes"
Case RadReminderStringId.AlarmFormSnoozeThirtyMinutes
Return "30 minutes"
Case RadReminderStringId.AlarmFormSnoozeThreeDays
Return "3 days"
Case RadReminderStringId.AlarmFormSnoozeTwoDays
Return "2 days"
Case RadReminderStringId.AlarmFormSnoozeTwoHours
Return "2 hours"
Case RadReminderStringId.AlarmFormSnoozeTwoWeeks
Return "2 weeks"
Case RadReminderStringId.DueInDay
Return "day"
Case RadReminderStringId.DueInDays
Return "days"
Case RadReminderStringId.DueInHour
Return "hour"
Case RadReminderStringId.DueInHours
Return "hours"
Case RadReminderStringId.DueInMinute
Return "minute"
Case RadReminderStringId.DueInWeek
Return "week"
Case RadReminderStringId.DueInWeeks
Return "weeks"
Case RadReminderStringId.DueInNow
Return "now"
Case RadReminderStringId.DueInOverdue
Return "{0} overdue"
Case RadReminderStringId.AlarmFormSelectMoreRemindObjects
Return " reminders are selected."
End Select
Return MyBase.GetLocalizedString(id)
End Function
End Class
To apply the custom localization provider, instantiate and assign it to the current localization provider:
Change the Current Provider
RadReminderLocalizationProvider.CurrentProvider = new EnglishReminderLocalizationProvider();
RadReminderLocalizationProvider.CurrentProvider = New EnglishReminderLocalizationProvider()
The code provided above illustrates the approach to be used to localize the RadReminder and is not intended as a full translation.