This is a migrated thread and some comments may be shown as answers.

Localization problem with RadUpload title

1 Answer 67 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Licenses
Top achievements
Rank 1
Licenses asked on 20 Dec 2010, 01:53 PM

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

1 Answer, 1 is accepted

Sort by
0
Alex Fidanov
Telerik team
answered on 21 Dec 2010, 10:15 AM
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
Tags
Upload
Asked by
Licenses
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Share this question
or