Telerik UI for Windows Phone by Progress

The string loaders are classes that implement the IStringResourceLoader interface. It contains a single GetString() method that is called by the localization logic in order to retrieve a localized string. With this interface users can have all their localized strings directly in their codebase, without the need for resource files and resource managers. The string loader objects have higher precedence than resource managers when the actual resource source is evaluated. For a more detailed explanation see the Overview topic.

Here is how to create a custom string loader implementation and set it on Telerik Input localization manager. First a class that implements IStringResourceLoader needs to be declared:

CopyC#
public class MyInputStringLoader : IStringResourceLoader
{
    public string GetString(string key)
    {
       switch (key)
       {
        case InputLocalizationManager.LeapYearKey:
               return "Localized leap year value";
        case InputLocalizationManager.EmptyDateContentKey:
               return "Localized empty date content value";

        case InputLocalizationManager.EmptyTimeContentKey:
               return "Localized empty time content value";
       }
       return null;
    }
}

Below are two examples. The first example sets the instance of this class to the StringLoader of the InputLocalizationManager and the second one sets the global string loader:

Setting the InputLocalizationManager's StringLoader:

CopyC#
InputLocalizationManager.Instance.StringLoader = new MyInputStringLoader();

Setting the GlobalStringLoader:

CopyC#
LocalizationManager.GlobalStringLoader = new MyInputStringLoader();

Since the local localization manager has a higher priority than the global, we need to make sure that all local string loaders, that should use the global resources, are set to null:

CopyC#
InputLocalizationManager.Instance.StringLoader = null;