How can I change Localization of a RadUpload at runtime.

Thread is closed for posting
6 posts, 0 answers
  1. Gary
    Gary avatar
    15 posts
    Member since:
    Sep 2010

    Posted 23 Nov 2010 Link to this post

    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

     

  2. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 26 Nov 2010 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gary
    Gary avatar
    15 posts
    Member since:
    Sep 2010

    Posted 26 Nov 2010 Link to this post

    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
  5. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 02 Dec 2010 Link to this post

    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.
  6. Gary
    Gary avatar
    15 posts
    Member since:
    Sep 2010

    Posted 02 Dec 2010 Link to this post

    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
  7. Helen
    Admin
    Helen avatar
    1052 posts

    Posted 06 Dec 2010 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017