Telerik UI for Windows Phone by Progress

Creating german localization for Telerik.Windows.Controls.Input

In order to create german localization for the Input assembly we first need to add a resx file to our project. Maker sure the project has references to Telerik.Windows.Controls.Input.dll as well as to Telerik.Windows.Core.dll.

Right click on the project and select Add -> NewItem:

New Item

 

Then select "Resource File" and name it MyLocalizedResources:

New Item Dialog

Now open the resx file and add the following names and values:

Localized Strings

The names are the keys with which the LocalizationManager looks up localized values. These keys are string constants and can directly be inspected in visual studio. For example to see the keys of the InputLocalizationManager, the manager responsible for localizing the Input assembly, simply go to the definition of the Telerik.Windows.Controls.InputLocalizationManager class with your favorite visual studio short-cut. The disassembled code will look like similar to this:

CopyC#
#region Assembly Telerik.Windows.Controls.Input.dll, v2.0.50727
namespace Telerik.Windows.Controls
{
    using System;

    // Summary:
    // A singleton class that represents a localization manager responsible for
    // localizing resources in the Telerik.Windows.Controls.Input assembly. public sealed
    class InputLocalizationManager : LocalizationManager
    {
        // Summary:
        // Defines the key for looking-up the "Select date" string. 
        public const string EmptyDateContentKey = "EmptyDateContent"; 

        // 
        // Summary:
        // Defines the key for looking-up the "Select time" string. 
        public const string EmptyTimeContentKey = "EmptyTimeContent";

        // 
        // Summary:
        // Defines the key for looking-up the "Leap Year" string. 
        public const string LeapYearKey = "LeapYear";

        // Summary:
        // Gets a string that is displayed in the Telerik.Windows.Controls.RadDatePicker
        // when there is no date selected in the control. 
        public string EmptyDateContentString { get; }

        // 
        // Summary:
        // Gets a string that is displayed in the Telerik.Windows.Controls.RadTimePicker
        // when there is no time selected in the control. 
        public string EmptyTimeContentString { get; } 

        // 
        // Summary:
        // Gets the only instance of the Telerik.Windows.Controls.InputLocalizationManager
        // class. 
        public static InputLocalizationManager Instance { get;
    }
}

In the same way you can see the keys for every other localization manager and provide localized values for those keys.

After the resx file is populated with the localized values you have to assign the ResourceManager object associated with the resx file to the

InputLocalizationManager.ResourceManager property at some point before the InitializeComponent() method call of your MainPage. For example:

CopyC#
public partial class MainPage : PhoneApplicationPage
{
    // Constructor
    public MainPage()
    {
        Telerik.Windows.Controls.InputLocalizationManager.Instance.ResourceManager = MyLocalizedResources.ResourceManager;
        InitializeComponent();
    }
}

The MyLocalizedResources class is auto-generated by visual studio when the resx file was created.

This is all there is to it. Now the controls in the input assembly should have german localization.