Localizing RadEditor by Using Global Resource Files

45 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1688 posts
    Member since:
    Oct 2004

    Posted 20 Sep 2007 Link to this post


    The Localization of the new RadEditor "Prometheus" now works with resource files and not with XML files as before. This change was made as resources represent the standard ASP.NET 2.0 mechanism for doing this with extensive built-in support in Visual Studio. As a result, it is a much easier approach for the developer in creating or changing a localization. Another major advantage of this is it is also much easier to deploy and maintain.

    The RadEditor "Prometheus" localization is contained in resource files .resx which are within the product dll. Please, note that only the English localization is built-in the control dll.

    To create your own localizations for the editor, you need to create the App_Global Resources folder in the root of your web application and copy the English resx files. These files are:

    • RadEditor.Main.resx
    • RadEditor.Tools.resx

    and they can be downloaded from this forum sticky note.

    After you have copied the resx files, you must duplicate each copy of these files and rename them using the syntax shown in the few examples below:

    • RadEditor.Tools.<Your_Language>.resx
    • RadEditor.Main.<Your_Language>.resx

    All resx file contain two columns: Name and Value as it is shown below:

    The image “http://www.telerik.com/help/radcontrols/prometheus/images/Localization.png” cannot be displayed, because it contains errors.

    The image “http://www.telerik.com/help/radcontrols/prometheus/images/hs-note.gif” cannot be displayed, because it contains errors. It is mandatory to set the ReservedResource string in the Name column of the RadEditor.Tools.<Language>.resx file. Without this string the resource files will not be recognized.

    Once you do that you can localize the strings in the Value column. You need to localize the strings in the Value column of your new resx files.

    The next step is to set the Language property of RadEditor to the name of the <localization> string in the RadEditor.Tools.<language>.resx file:
    Inline in the RadEditor's declaration:
    <telerik:radeditor runat="server" ID="RadEditor1" Language="it-IT"></telerik:radeditor>
    In the CodeBehind:
    C#: RadEditor1.Language = "it-IT";
    VB.NET: RadEditor1.Language = "it-IT"

    The image “http://www.telerik.com/help/radcontrols/prometheus/images/hs-note.gif” cannot be displayed, because it contains errors. If you provide a new localization for RadEditor "Prometheus" which works properly, we will gladly reward you for your work.



  2. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 07 Nov 2007 Link to this post

    I need to be able to set the resource directory to another folder to get this working in DNN properly. Is that supported?
  3. Rumen
    Admin
    Rumen avatar
    13043 posts

    Posted 07 Nov 2007 Link to this post

    Hi Philipp,

    RadEditor uses the standard ASP.NET 2.0 mechanism for loading it localization from the App_Global Resources folder. If you want to change the resource location then you should write your custom resource provider as it is described in the following MSDN article:

    Extending the ASP.NET 2.0 Resource-Provider Model


    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  4. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 07 Nov 2007 Link to this post

    That's not the point. My point is that if I deliver custom modules for the dotnetnuke framework utilizing Teleriks controls I would usually have â folder called "APP_Localresources" beneath my module folder where I load all resources for my module. This is a design issue in dotnetnuke.

    When I distribute a custom module I have no possibility to add resources to the app_Global resources folder from within the installation process fo my module. Those have to reside in my module folder.
  5. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 08 Nov 2007 Link to this post

    Hi,

    Perhaps it will be possible to compile the resx files into assemblies and load them from the bin folder. You can deploy the resources assembly along with the Telerik.Web.UI.dll file.

    The other problem that you need to solve is, that the editor needs two HTTP Handlers in the web.config file. I don't think that there is a way to modify the Web.config handlers configuration from a PA installer. However, you should be able to add them using the following code:

    HttpModulesSection HttpModules = (HttpModulesSection)Configuration.GetSectionGroup("system.web").Sections["httpModules"];  
    HttpModules.Modules.Add(new HttpModuleAction(name, assemblyQualifiedName));  
    Configuration.Save(); 

    You can include the code in one of the module's controls. Note that you only need to add the handlers once and that it will recycle the application (since the web.config file will be updated).

    Greetings,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. garfield
    garfield avatar
    66 posts
    Member since:
    Jun 2006

    Posted 07 Feb 2008 Link to this post

    Has RadEditor been translated to spanish, or has anybody submited translated localization files?

    Thanks
  7. Rumen
    Admin
    Rumen avatar
    13043 posts

    Posted 07 Feb 2008 Link to this post

    Hello garfield,

    I searched in our storage and was able to find localization files for RadEditor 6.x Classic only. They are available for download in the My Licenses section under your Client.net account.

    For your convenience I have attached the requested Spanish localization.

    Best regards,
    Rumen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  8. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 05 May 2008 Link to this post

    So from what I investigated localization cannot be used in dnn out of the box - even the current beta provider for RadEditor does not solve what appears to be the problem.

    DNN explicitly denies resx compilation, so while you can set the language of the editor to the one being used in dnn, it does simply not affect the rendered language, simply because the editor cannot find a resource for the requested language.
  9. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 07 May 2008 Link to this post

    Hello Philipp,

    You are correct. DotNetNuke uses resource (.resx) file in a way that is different from the .NET framework. That is why resource files are not compiled by default. However, I think that enabling their compilation will not lead to any problems (other than a bit slower start for the site). You can try it for yourself - simply remove the line

    <remove extension=".resx" />

    from the DNN Web.config file.

    Greetings,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 07 May 2008 Link to this post

    That does not work for two reasons:

    1. The Core has now decided to no longer work with rex headers in resourcefiles

    2. The Core also works with portal wide localizations, e.g. resx files in the format resources.portal-0.resx

    For both reasons compilation of resx files will fail.
  11. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 07 May 2008 Link to this post

    You might consider to optionally support the old scenario using xml localization by setting. Maybe two settings:

    - usexmllocalization
    - resourcefilelocation
  12. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 09 May 2008 Link to this post

    Hi Philipp,

    Thanks for the suggestion. We are considering having two localization mechanisms in the editor - RESX and XML files. If we decide to bring back the XML localization, the earliest we will be able to implement it in the next major release.

    Regards,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. Heinz
    Heinz avatar
    20 posts
    Member since:
    Mar 2008

    Posted 11 Jun 2008 Link to this post

    Did I get this right? That means that I cannot use RadEditor in German DNN-installations, because there is no way to get German localization to run?
    So where is the Telerik commitment to DNN? I think RadEditor is one of the most important parts of the suite in DNN environments. 
  14. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 12 Jun 2008 Link to this post

    Hi,

    It is not impossible to use German or any other RadEditor localization in DNN. Here is what you need to do (assuming you have already deployed the editor in your portal):

    1. open the DNN web.config file and remove the line:

    <remove extension=".resx"/>

    2. Download the latest hotfix build from our site (My Licenses > My Purchases > RadControls for ASP.NET AJAX > Downloads). Currently this is RadControls_for_ASP.NET_AJAX_2008_1_515_dev_hotfix.zip

    3. Extract the App_GlobalResources folder from the hotfix archive in the App_GlobalResources folder of your DNN site. This will install the german localization files for RadEditor.

    After that, the editor will automatically switch to German if the portal or page settings say that de-DE is the current localization.

    The same steps apply for all languages. I am attaching a screenshot of the RadEditor in a french localized DNN portal.

    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  15. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 12 Jun 2008 Link to this post

    Not sure if you have read my previous post correctly. Resx compilation will fail in almost every use case because:

    • many language packs for dnn dot NOT include Resx headers anymore to reduce load time
    • if one creates only a single portal specific translation key, the resourcefile in question is being renamed to contain the portal id in its filename

    both these issues lead to complation exceptions.

  16. Eric Villemure
    Eric Villemure avatar
    19 posts
    Member since:
    Feb 2008

    Posted 13 Jun 2008 Link to this post

    Hi, is it possible to have the Spanish translation for the RadEditor in aspx format?

    Thanks
  17. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 16 Jun 2008 Link to this post

    Hi Philip,

    As I said earlier, we will provide an alternate way to localize the editor in the next major release. For now you will have to use the default english localization if your DNN language pack does not work with .resx compilation. Alternatively, you can do a global find & replace in the .resx files and add the missing header for those that need it. I think this should allow you to run the DNN site without problems. Here is a sample header you can use:

      <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">  
        <xsd:element name="root" msdata:IsDataSet="true">  
          <xsd:complexType> 
            <xsd:choice maxOccurs="unbounded">  
              <xsd:element name="data">  
                <xsd:complexType> 
                  <xsd:sequence> 
                    <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> 
                    <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> 
                  </xsd:sequence> 
                  <xsd:attribute name="name" type="xsd:string" /> 
                  <xsd:attribute name="type" type="xsd:string" /> 
                  <xsd:attribute name="mimetype" type="xsd:string" /> 
                </xsd:complexType> 
              </xsd:element> 
              <xsd:element name="resheader">  
                <xsd:complexType> 
                  <xsd:sequence> 
                    <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> 
                  </xsd:sequence> 
                  <xsd:attribute name="name" type="xsd:string" use="required" /> 
                </xsd:complexType> 
              </xsd:element> 
            </xsd:choice> 
          </xsd:complexType> 
        </xsd:element> 
      </xsd:schema> 
      <resheader name="ResMimeType">  
        <value>text/microsoft-resx</value> 
      </resheader> 
      <resheader name="Version">  
        <value>1.0.0.0</value> 
      </resheader> 
      <resheader name="Reader">  
        <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutralPublicKeyToken=b77a5c561934e089</value>  
      </resheader> 
      <resheader name="Writer">  
        <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutralPublicKeyToken=b77a5c561934e089</value>  
      </resheader> 


    Best wishes,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  18. tango
    tango avatar
    6 posts
    Member since:
    Apr 2007

    Posted 28 Jun 2008 Link to this post

    Hi,

    I have dowloading your last trial version Telerik.DNN.Modules_2008_1_515_trial.zip
    and use the resx files from RadControls_for_ASP.NET_AJAX_2008_1_619_trial_hotfix.zip  in the  App_GlobalResources.

    I can't use your editor in french language because when I try to remove <remove extension=".resx"> in web.config file, I have a lot of errors in many modules when the application starts.

    Do you have an idea to translate correctly your editor ?

    Tango
  19. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 01 Jul 2008 Link to this post

    Hi,

    Which french localization files are you using? I tried with the "French Language Pack [04.08.00] Core" from the DNN site and did not have any problems. What are the errors you see (exception details, stack trace)? Are they caused only by specific (third party) modules or all modules (even the ones that come with the DNN installation)?


    All the best,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  20. tango
    tango avatar
    6 posts
    Member since:
    Apr 2007

    Posted 02 Jul 2008 Link to this post

    Hi,

    I have this problem with the Catalook module. (http://www.dnnsoft.com)

    If I remove <remove extension=".resx"> all catalooks module are broken and all the site is very slow.

    Tango
  21. tango
    tango avatar
    6 posts
    Member since:
    Apr 2007

    Posted 03 Jul 2008 Link to this post

    Hi,

    I have a new problem :  when I try to insert two telerik rad ajax editor in the same form, all drop down list (css style, links...) don't work .

    I would like buy your editor but without remove  .resx  ligne in web.config and without bug when I try to add more than one editor in the same form.

    Can you add also an option to allow a registered user to save document, images... in a private directory (*\portals\[portalnumber]\mediausers\[username]\   [document or media or image or template] )

    Thanks for your support

    Tango
  22. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 03 Jul 2008 Link to this post

    Hello,

    Unfortunately, I could not find a free trial version of these modules so I can test them locally. At the moment, you have two options:

    1) you can leave the <remove extension=".resx"> line and continue using the editor with english only language until we bring back the XML localization files support

    2) you can try the workaround from my last message to Philip - add a valid resource file header to the Catalook module's localization files so they compile correctly.


    Starting with the next release, we will make the German and French DNN localizations available through separate assemblies (Telerik.Web.UI.resources.dll) so it will be possible to have a localized editor even with the <remove ...> line in the web.config file. Once again I would like to apologize for the inconvenience.

    Greetings,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  23. tango
    tango avatar
    6 posts
    Member since:
    Apr 2007

    Posted 04 Jul 2008 Link to this post

    Thanks,

    I will wait your next trial to buy your product. Can you solve also the problem when more than one editor is use in the same form (all drop down lists are not available).
    Also if you can have an enhancement to allow a registered user to have a private directory to publish contents (images, document, template, media...)

    Great regards

    Tango
  24. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 08 Jul 2008 Link to this post

    Hello Tango,

    The editor provider has a property EnableUploadUserFolders. When you set it to true (from the Web.config provider definition), the editor will automatically create a separate folder for each user so they can upload content separately.

    The problem with dropdowns is probably related to the skin you are using - more specifically, it does not have a XHTML doctype. Since our editor is built to work primarily on XHTML pages, there are still some glitches when it is in a non-XHTML page. However, we are constantly improving the support for pages with no doctype and I am sure that the problem with dropdowns will be fixed very soon.

    Regards,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  25. tango
    tango avatar
    6 posts
    Member since:
    Apr 2007

    Posted 08 Jul 2008 Link to this post

    Hi,

    thanks for your response.

    but I can't do anything I want. Can you consider something bellow in a release ?

    SelectImagesPathGuest ="images/Guest"
    UploadImagesPathGuest ="images/Guest"

    SelectImagePathAdmin ="*PortalRoot*, 
    UploadImagesPathAdmin ="*images/*user*"

    SelectImagePathHost ="*PortalRoot*"
    UploadPathHost ="*PortalRoot*"

    SelectImagePathRegisteredUser ="SharedLibraryForRegisteredUsers, images/*user*"
    UploadPathRegisteredUser="images/*users*"

    SelectImagePathRoles =" MyRole, images/MyRole/*user*"
    UploadImagePathRoles =" MyRole, images/MyRole/*user*"

    Great Regards

    Tango

  26. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 09 Jul 2008 Link to this post

    Hi Tango,

    I have added your request to our database. We will consider adding a special token *User* or *Group* to the ImagesPaths editor property. Note that in DNN there is no separate property for upload paths - we use the DNN permissions to decide whether a user has read/write rights to a folder.

    Kind regards,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  27. Daniel Mettler
    Daniel Mettler avatar
    20 posts
    Member since:
    Apr 2003

    Posted 18 Sep 2008 Link to this post

    Hi

    Philipp posted: "We are considering having two localization mechanisms in the editor - RESX and XML files. If we decide to bring back the XML localization, the earliest we will be able to implement it in the next major release."

    RadControls for ASP.NET AJAX Q2 2008 are out. I couln't find any changes related to this issue. What's the current status? Is it now possible to localize RadEditor in DNN without removing the <remove extension=".resx"/> node?

    Thanks
  28. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 19 Sep 2008 Link to this post

    Hi,

    The new localization mechanism was not implemented in the Q2 release. Our biggest priority for the Q2 release was improving the editor dialogs and we had to postpone some other tasks, including the localization problems, for the next major release Q3. Please accept our apologies for the delay.

    Greetings,
    Lini
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  29. Philipp Becker
    Philipp Becker avatar
    59 posts
    Member since:
    Nov 2005

    Posted 01 Nov 2008 Link to this post

    I can't find this topic in the release notes for the Q3 beta. Again postponed?
  30. Rumen
    Admin
    Rumen avatar
    13043 posts

    Posted 03 Nov 2008 Link to this post

    Hi Philipp,

    We were concentrated on implementing other features and bug fixes and we were not have enough time to implement the new localization mechanism. It is still in our ToDo list and our developers will try to implement it in one of the upcoming versions of the control.

    Unfortunately, I cannot provide an exact time estimate on when it will become available.

    Best regards,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top