rte localization

Hi,

based on your sample from https://help.syncfusion.com/aspnetmvc/richtexteditor/localization I want to realize a localization of the formats.

@{
        Syncfusion.JavaScript.Models.RTEproperties rte = new Syncfusion.JavaScript.Models.RTEproperties();

        List<Syncfusion.JavaScript.Models.Format> list = new List<Syncfusion.JavaScript.Models.Format>{
            new Syncfusion.JavaScript.Models.Format { Text= "Absatz", Value= "p", SpriteCssClass= "e-paragraph" },
            new Syncfusion.JavaScript.Models.Format { Text= "Zitat", Value= "blockquote", SpriteCssClass= "e-quotation" },
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 1", Value= "h1", SpriteCssClass= "e-h1"} ,
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 2", Value= "h2", SpriteCssClass= "e-h2" },
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 3", Value="h3", SpriteCssClass= "e-h3" },
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 4", Value= "h4", SpriteCssClass= "e-h4" },
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 5", Value= "h5", SpriteCssClass= "e-h5" },
            new Syncfusion.JavaScript.Models.Format { Text= "Kopf 6", Value= "h6", SpriteCssClass= "e-h6" }
        };
        rte.Format = list;
        rte.Value = "Das RichTextEditor (RTE) Steuerung ermöglicht Ihnen, den Inhalt mit Einsatz Tisch und Bilder zu bearbeiten ," +
        " sondern bietet auch eine Werkzeugleiste , die Rich-Text- Format ," +
        " um die in der Textarea eingegeben Gehalt gelten können.";
        rte.Locale = "de-DE";
       
    }
    
    @{Html.EJ().RTE("rteSample", rte).Render();}.

When I try to implement this into another sample it wont work. If I set the rte it's not possible to set other values like the width. I've attached a simple project which is based on your samples. rteSample1 and rteSample2 are fine, rteSample3 can't be compiled. What is the right way to combine 1 & 2? Can you please modify rteSample3, so it can be compiled.

regards,
Patrick

Attachment: SyncfusionMvcApplicationRTE_5a7505cb.zip

3 Replies

KR Keerthana Rajendran Syncfusion Team May 28, 2018 07:15 AM UTC

Hi Patrick,   
   
Thank you for contacting Syncfusion Support.   
   
While rendering RTE through RTEproperties from JavaScript models, you need to declare all the required properties with the model. For example, if you wish to set width for RTE you can add the property as shown below.    
   
@{   
            Syncfusion.JavaScript.Models.RTEproperties rte = new Syncfusion.JavaScript.Models.RTEproperties();   
   
            List<Syncfusion.JavaScript.Models.Format> list = new List<Syncfusion.JavaScript.Models.Format>{   
new Syncfusion.JavaScript.Models.Format { Text= "Absatz", Value= "p", SpriteCssClass= "e-paragraph" },   
new Syncfusion.JavaScript.Models.Format { Text= "Zitat", Value= "blockquote", SpriteCssClass= "e-quotation" },   
new Syncfusion.JavaScript.Models.Format {  Text= "Kopf 1", Value= "h1", SpriteCssClass= "e-h1"} ,   
new Syncfusion.JavaScript.Models.Format { Text= "Kopf 2", Value= "h2", SpriteCssClass= "e-h2" },   
new Syncfusion.JavaScript.Models.Format { Text="Kopf 3", Value="h3", SpriteCssClass= "e-h3" },   
new Syncfusion.JavaScript.Models.Format { Text= "Kopf 4", Value= "h4", SpriteCssClass= "e-h4" },   
new Syncfusion.JavaScript.Models.Format { Text= "Kopf 5", Value= "h5", SpriteCssClass= "e-h5" },   
new Syncfusion.JavaScript.Models.Format { Text= "Kopf 6", Value= "h6", SpriteCssClass= "e-h6" }   
};   
            rte.Format = list;   
            rte.Value = "Das RichTextEditor (RTE) Steuerung ermöglicht Ihnen, den Inhalt mit Einsatz Tisch und Bilder zu bearbeiten ," +   
            " sondern bietet auch eine Werkzeugleiste , die Rich-Text- Format ," +   
            " um die in der Textarea eingegeben Gehalt gelten können.";   
            rte.Locale = "de-DE";   
            rte.Width = "600px";   
   
        }   
@{Html.EJ().RTE("rteSample3"rte).Render();}   
   
Else, you can render properties with RTE as done for “rteSample2” without using model. But you can’t combine both in single code.   
   
We have modified your sample and attached in the below link.   
   
   
   
Regards,   
Keerthana.   
  
 



PR Patrick Rogalski May 28, 2018 07:34 AM UTC

Hi Keerthana,

thanks for clarification and the modification of the project - that solves my issue!

Best regards,
Patrick


KR Keerthana Rajendran Syncfusion Team May 29, 2018 04:22 AM UTC

Hi Patrick, 
 
Most Welcome. We are glad that your issue has been resolved. Please let us know if you need further assistance on this. We will be happy to assist you. 
 
Regards, 
Keerthana. 


Loader.
Up arrow icon