New to Telerik UI for WinForms? Start a free 30-day trial
Localization
Updated over 6 months ago
RadMessageBox provides localization of its buttons text via RadMessageLocalizationProvider:
1. Start by creating a descendant of the RadGridLocalizationSettings class. Then, override the GetLocalizedString(string id) method, and in its implementation, provide a translation for the label and user messages. If one is not provided, the default value will be returned - this is guaranteed by the call to the base GetLocalizedString method in the default clause of the switch statement.
Creating a custom localization provider
C#
public class MyRadMessageLocalizationProvider : RadMessageLocalizationProvider
{
public override string GetLocalizedString(string id)
{
switch (id)
{
case RadMessageStringID.AbortButton: return "Abbruch";
case RadMessageStringID.CancelButton: return "Löschen";
case RadMessageStringID.IgnoreButton: return "Ignorieren";
case RadMessageStringID.NoButton: return "Nein";
case RadMessageStringID.OKButton: return "OK";
case RadMessageStringID.RetryButton: return "Wiederholung";
case RadMessageStringID.YesButton: return "Ja";
default:
return base.GetLocalizedString(id);
}
}
}
2. To apply the custom localization provider, instantiate and assign it to the current localization provider:
Setting the custom localization provider to RadMessageBox
C#
RadMessageLocalizationProvider.CurrentProvider = new MyRadMessageLocalizationProvider();