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