Localization problem with RadUpload title

2 posts, 0 answers
  1. Sodi We
    Sodi We avatar
    160 posts
    Member since:
    Apr 2010

    Posted 20 Dec 2010 Link to this post

    Hello,

    I have implemented localization functionality in my silverlight application for the RadUpload control, to make sure that the title, button texts... are displayed in the preferred language of the user. However, when I run my silverlight application and open a page in which the RadUpload control is implemented, then the RadUpload control title is still the default title (Select files to upload) instead of the correct translated title.

    What I find strange is that when I upload a file and then cancel that upload, the title of the RadUpload control changes in the correct translation.
     
    I implemented a custom LocalizationManager class to apply localization on the RadUpload control. 'CommonResources' is the name of a .resx file that contains the translations.

    public class CustomLocalizationManager: LocalizationManager
        {
            private static Dictionary<string, string> myStrings;
      
            static CustomLocalizationManager()
            {
                myStrings = new Dictionary<string, string>();
                myStrings.Add("UploadBrowse", CommonResources.UploadBrowse);
                myStrings.Add("UploadCancel", CommonResources.UploadCancel);
                myStrings.Add("UploadCaptionSelect", CommonResources.UploadCaptionSelect);
                myStrings.Add("UploadCaptionSelected", CommonResources.UploadCaptionSelected);
                myStrings.Add("UploadCaptionUploaded", CommonResources.UploadCaptionUploaded);
                myStrings.Add("UploadCaptionUploading", CommonResources.UploadCaptionUploading);
                myStrings.Add("UploadPause", CommonResources.UploadPause);
                myStrings.Add("UploadResume", CommonResources.UploadResume);
                myStrings.Add("UploadTotal", CommonResources.UploadTotal);
                myStrings.Add("UploadUpload", CommonResources.UploadUpload);
            }
      
            public override string GetStringOverride(string key)
            {
                string value = string.Empty;
                if (myStrings.TryGetValue(key, out value))
                {
                    return value;
                }
                return base.GetStringOverride(key);
            }
        }

    I use this CustomLocalizationManager class in the code-behind of the XAML, like so:
    /// <summary>
    /// Constructor
    /// </summary>
    public NewUploadView()
    {
        LocalizationManager.Manager = new CustomLocalizationManager();
        InitializeComponent();
    }

    Any ideas?

    Thanks
    Sodi
  2. Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 21 Dec 2010 Link to this post

    Hello Sodi We,

    This issue was recently resolved. Please re-test this with out latest internal builds for Q3 and you should be able to see the correct localization strings. Let us know if you still have an issue with this.

    All the best,
    Alex Fidanov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top