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

Arabic and english words in editor

8 Answers 220 Views
Editor
This is a migrated thread and some comments may be shown as answers.
arda
Top achievements
Rank 1
arda asked on 05 Nov 2018, 11:04 AM

Hi,

I would like to support English and Arabic same time. For example, when the user enter English and Arabic text i want to get same html in javascript but the radeditor content doesn't same with the html text in javascript its like vice versa. I added screenshots about my issue. 

Thank you for your quick reply. 

 

 

 

8 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Nov 2018, 02:38 PM
Hi Arda,

Can you try to obtain the content by adding the setting the true parameter of the get_html(true) method? If there is no difference, then switch to HTML mode of RadEditor and see whether the rtl formatting is applied by inline style or is applied to the content area body element by a CSS style.

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
arda
Top achievements
Rank 1
answered on 06 Nov 2018, 06:37 AM

Hi Rumen,

I tried to get content by get_html(true) but nothing changes. It applied content body by a style i attach the screenshot.

0
Rumen
Telerik team
answered on 06 Nov 2018, 08:05 AM
Hi Arda,

Thank you for the research and important details!

The get_html() method obtains and returns the content only, but not the formatting of the content area. If the content contains inline styles they will be part of the string returned by the get_html(), but otherwise not.

If you want to get the formatting of the content area you can do it like this:

var editor = $find("<%=RadEditor1.ClientID%>");
var contentArea = editor.get_contentArea();
console.log(contentArea.style.textAlign);

Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
arda
Top achievements
Rank 1
answered on 06 Nov 2018, 10:12 AM

Hi Rumen,

I inspect the radeditor html and the body text is different than what i see on the content. H     

0
arda
Top achievements
Rank 1
answered on 06 Nov 2018, 10:19 AM

Hi Rumen,

Sorry for the other post.

I inspect the radeditor html and the body text is different than what i see on the content. I want to get the same text on the radeditor. It shows the right txt because of 'direction:rtl' css. How can i format the text which i get from the editor?

I attach the diference between interface and real content.

0
Rumen
Telerik team
answered on 06 Nov 2018, 04:50 PM
Hello,

The content area of RadEditor is a standard editable div/iframe element and if the formatting is not applied with inline styles to the edited content, you cannot obtain the content with the formatting since it is applied to its parent body element.

A similar problem is discussed in this article: No FONT tags are applied when I type text in the editor.

You can load the content area with some predefined paragraph element with align:right or text-align: right formatting so that this is available as content and you can obtain the content after that via the editor.get_html(true); function:

<telerik:RadEditor ID="RadEditor1" runat="server">
    <Content>
        <p style="text-align:right">&nbsp;</p>
    </Content>
</telerik:RadEditor>


Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
arda
Top achievements
Rank 1
answered on 09 Nov 2018, 08:25 AM

Hi Rumen,

This solution helps me a lot.

Thank you for your answer.

 

0
Rumen
Telerik team
answered on 09 Nov 2018, 09:50 AM
You are welcome, Arda! Keep up the good work!

Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Editor
Asked by
arda
Top achievements
Rank 1
Answers by
Rumen
Telerik team
arda
Top achievements
Rank 1
Share this question
or