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

Localization

To localize RadWizard to display control text and messages in a specific language:

  • All required classes for localization are defined in Telerik.WinControls.UI.Localization namespace.

  • Start by creating a descendant of the RadWizardLocalizationProvider 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 of 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:

Localizing RadWizard Strings

class MyWizardLocalizationProvider : RadWizardLocalizationProvider
{
    public override string GetLocalizedString(string id)
    {
        switch (id)
        {
            case RadWizardStringId.BackButtonText: return "<   Back";
            case RadWizardStringId.NextButtonText: return "Next   >";
            case RadWizardStringId.CancelButtonText: return "Cancel";
            case RadWizardStringId.FinishButtonText: return "Finish";
            case RadWizardStringId.HelpButtonText: return "<html><u>Help</u></html>";
            default: return string.Empty;
        }
    }
}

Class MyWizardLocalizationProvider
    Inherits RadWizardLocalizationProvider
    Public Overrides Function GetLocalizedString(id As String) As String
        Select Case id
            Case RadWizardStringId.BackButtonText
                Return "<   Back"
            Case RadWizardStringId.NextButtonText
                Return "Next   >"
            Case RadWizardStringId.CancelButtonText
                Return "Cancel"
            Case RadWizardStringId.FinishButtonText
                Return "Finish"
            Case RadWizardStringId.HelpButtonText
                Return "<html><u>Help</u></html>"
            Case Else
                Return String.Empty
        End Select
    End Function
End Class

To apply the custom localization provider, instantiate and assign it to the current localization provider:

Assigning the Current Localization Provider

RadWizardLocalizationProvider.CurrentProvider = new MyWizardLocalizationProvider();

RadWizardLocalizationProvider.CurrentProvider = New MyWizardLocalizationProvider()

The code provided above illustrates the approach to be used to localize RadWizard and it is not intended as a full translation.

See Also

In this article