Multiple LocalizationManagers

4 posts, 0 answers
  1. Fredrik
    Fredrik avatar
    58 posts
    Member since:
    Mar 2013

    Posted 22 Oct 2013 Link to this post

    Hello!
    in my project i use several diffrent telerik controls that i need to overide its default Localization resource and replace it with my own.

    I do this in a own baseview class witch all my other view classes inherits.

    private void InitLocalizationManagers()
    {
    LocalizationManager.Manager = new LocalizationManager()
    {
    ResourceManager = Parka.Resources.Localization.GridViewResources.ResourceManager

    };

    LocalizationManager.Manager = new LocalizationManager()
    {
    ResourceManager = Parka.Resources.Localization.RadImageEditor.ResourceManager
    };


    }

    However my problem is when i need to set up multiple resources for the diffrent controls.
    in the example over i can only set the one resource since the top one will be overwritten.
    i need to be able to set multiple



  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 25 Oct 2013 Link to this post

    Hi,

    You can set different LocalizationManagers for the different controls.
    You can create two localization managers and assign them to the corresponding controls (RadGridView and RadImageEditor) before the UI is created.

    As to RadGridView, you can subscribe for the DataLoaded event and execute a code similar to this one:

    private void playersGrid_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
    {
        LocalizationManager.Manager = new LocalizationManager()
                 {
                     ResourceManager = Parka.Resources.Localization.GridViewResources.ResourceManager
                  };
    }

    That way the localization will only be applied to this particular control.

    Still you can only assign one LocalizationManager for your application. 

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Fredrik
    Fredrik avatar
    58 posts
    Member since:
    Mar 2013

    Posted 25 Oct 2013 Link to this post

    Hello, I work with mvvm and thus your sollution is not viable for me.
    i cannot subscribe for load event in every view and usercontrol i run telerik controls.
    i have my base view class for this purpose.

    is there no other way to assign ressourcemanager in a mvvm friendly way?
  5. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 25 Oct 2013 Link to this post

    Hello,

    You could use an attached behavior to assign your custom LocalizationManager in XAML and not in code behind. 
    You can also check our online documentation on localization.
     

    Regards,
    Didie
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top