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

How can I change Localization of a RadUpload at runtime.

5 Answers 222 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 2
Gary asked on 23 Nov 2010, 10:14 PM

Hello,

I am trying to figure out how to change the localization of the RadasyincUpload control at runtime.  I have read the article at: http://www.telerik.com/help/aspnet-ajax/localizing-radupload.html and have created the Required App_GlobalResources directory at my website root – it appears in IIS right under the App_Data folder on the same level.  I have added the RadUpload.resx file and created a RadUpload.es-ES.resx file with the appropriate language translations in it.

I create a RadAsyncUpload control at runtime as such

public Telerik.Web.UI.RadAsyncUpload _uploadControl = new Telerik.Web.UI.RadAsyncUpload();

Then I set some propertie:

  this._uploadControl.ID = "u" + this.QuestionID;

  this._uploadControl.InitialFileInputsCount = 1;

  this._uploadControl.MaxFileInputsCount = 1;

  this._uploadControl.FileUploaded += new FileUploadedEventHandler(File_FileUploaded);

  this._uploadControl.TemporaryFolder = _fileVirtualPath;

  this._uploadControl.TargetFolder =_fileVirtualPath ;

  this._uploadControl.HttpHandlerUrl = "~/RadUpload/RadUploadFile.ashx";

  this._uploadControl.Width = new Unit(250);

  this._uploadControl.CssClass = "normalRemoveButton";

 

Then I have some code to determine the culture and attempt to set the culture of the upload control like :
              

 

this._uploadControl.Culture = System.Globalization.CultureInfo.CreateSpecificCulture("es-ES");

 

Then the control is added to the page controls.

 

The control still shows all the buttons in English.

 

What am I doing wrong, how can I get this to work?

 


We are using Telerik.Web.UI version 2010.3.1109.35

Thanks,

 


Gary

 

5 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 26 Nov 2010, 10:22 AM
Hi Gary,

Please take a look at the following help article for information on how to localize RadUpload.

Sincerely yours,
Genady Sergeev
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Gary
Top achievements
Rank 2
answered on 26 Nov 2010, 06:32 PM
Hi Genady,

That is the localization article I read before trying the code I did.  It shows nicely how to set the localization at design time, but fails to explain how to set it at runtime.  I can not set this at design time because our application runs on several servers and the language (or localization is set at runtime depending on the incomming request.   For example - one reguest could be for English Localization while the next could be for French, or Spanish.

What I need to be able to do is once I detect the requested language, to dynamically set the control localization.  The code I tried should have done that, but it seems that the RadUpload did not use the resx file for RadUpload.es-ES.resx   nor does it seem to be using the RadUpload.resx file because I changed one of the 'Select' text in that one to Select-Eng' and even when that default resx file should have been used it aparently was not, because the button simply read 'Select'

Is it even possible to set the localization on a telerik control at runtime?

Thanks,

Gary
0
Helen
Telerik team
answered on 02 Dec 2010, 03:06 PM
Hi Gary,

Did you try the following server-side:

//localize the "Remove" button
Upload1.Localization.Remove = "MyRemove";


Kind regards,
Helen
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Gary
Top achievements
Rank 2
answered on 02 Dec 2010, 10:46 PM
Hi Helen,

Yess I have discovered that it can be don on an individual button by button basis, but I was hoping that somehow the localizatiojn files documented by Telerik could be used.  It appears though that those xml files can only be used at design time.  Is there no way that they can be used at runtime?

Thanks,

Gary
0
Helen
Telerik team
answered on 06 Dec 2010, 10:46 AM
Hello Gary,

Please find attached a project which demonstrates how to achieve this.

Hope this helps.

Regards,
Helen
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Upload (Obsolete)
Asked by
Gary
Top achievements
Rank 2
Answers by
Genady Sergeev
Telerik team
Gary
Top achievements
Rank 2
Helen
Telerik team
Share this question
or