WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#44053 closed defect (bug) (wontfix)

RTL problem in WordPress Text Editor

Reported by: man4toman Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Editor Keywords: has-screenshots has-patch close
Focuses: rtl, administration Cc:

Description

In RTL locale, when we change the editor to "text editor" it stills on RTL and the readability and editing the codes becomes hard.

Attachments (6)

problem.png (8.6 KB) - added by man4toman 3 years ago.
The problem
fixed.png (8.6 KB) - added by man4toman 3 years ago.
After fixing the problem
editor-rtl.css.patch (351 bytes) - added by man4toman 3 years ago.
SVN version of changes
editor.css.patch (386 bytes) - added by man4toman 3 years ago.
editor.css patch file
Screen Shot 2018-05-26 at 5.47.45 pm.png (511.7 KB) - added by netweb 3 years ago.
1.png (85.8 KB) - added by man4toman 3 years ago.

Download all attachments as: .zip

Change History (21)

@man4toman
3 years ago

The problem

@man4toman
3 years ago

After fixing the problem

@man4toman
3 years ago

SVN version of changes

#1 @swissspidy
3 years ago

  • Keywords needs-testing added

Related: #40194.

#2 @netweb
3 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 4.9.7

Welcome to Trac @man4toman and thanks for creating the ticket :)

The fix for this will need to be in the editor.css file rather than the editor-rtl.css file in your editor-rtl.css.patch patch. This is because we use RTLCSS to generate the editor-rtl.css file from the editor-rtl.css file.

You will need to use a RTLCSS ignore directive in the patch so once editor.css is compiled to editor-rtl.css continues to contain ltr rather than rtl

RTLCSS can also be tested online using http://rtlcss.com/playground/

@man4toman
3 years ago

editor.css patch file

#3 @man4toman
3 years ago

Thanks @netweb for your description.

So, I create new patch file for editor.css and it's here editor.css.patch

#4 @netweb
3 years ago

  • Keywords needs-refresh removed

Awesome, thanks @man4toman 👍🏼

#5 @man4toman
3 years ago

Any updates?
Text editor is very messy in RTL languages.

#6 @netweb
3 years ago

There are no other updates required @man4toman, a committer will review and commit the patch and it will ship in the 4.9.7 release of WordPress

#7 @man4toman
3 years ago

Thanks @netweb, then I wait for 4.9.7 release :)

#8 @desrosj
3 years ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#9 @desrosj
3 years ago

  • Keywords reporter-feedback added

@man4toman thanks for the ticket! Welcome to Trac!

I have not been able to reproduce this issue locally testing with TwentySeventeen.

Can you tell me which theme you were using when you noticed the issue? Also, which locale is your site using?

#10 @man4toman
3 years ago

Hi @desrosj and thank you :)

I tested it again and the problem is still there.

This information is for the latest test:

Wordpress version: 4.9.6

Theme name: Twenty Seventeen

Wordpress locale: فارسی (fa_IR)

Please tell me if anything else was needed.

Last edited 3 years ago by man4toman (previous) (diff)

#11 @netweb
3 years ago

  • Keywords close added; needs-testing reporter-feedback removed

@man4toman This also works "as expected" for me, in the screenshot above the post editor is on the left, the text is correctly displayed RTL, on the right is the plugin code editor and the code is correctly displayed LTR.

To clarify, the "Text" editor is not a "code editor", you can add code but it is designed as a "plain text" editor that allows you to inspect any HTML code that may be within the text of your post.

#12 @man4toman
3 years ago

Thanks @netweb

Yes, the "Text editor" is not a "Code editor" but when we use visual mode and then return to text mode to edit some HTML codes, the problem shows herself in RTL locale!

Many users request us to bring this section LTR, because the text and the code are intertwined, it's hard to edit the code and the text together.

@man4toman
3 years ago

#13 @man4toman
3 years ago

A new photo was added to clarify the issue. It shows why LTR text editor is better for our locale.

#14 @netweb
3 years ago

  • Milestone 4.9.8 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Thanks @man4toman I'm not sure this problem will be easily solvable, it will also affect all RTL locales and would warrant further discussion with those locales and the wider community

I think a good interim solution would be to create a plugin that offers the functionality you are seeking, that would also act as a good usgae indicator.

I had a quick for a plugin but didn't find an exact match, I did find this plugin that I think could be easily adapted to add the same functionality you are seeking: https://wordpress.org/plugins/wp-rtl/

I'm going to close this as wontfix for now as the current functionality works as expected.

#15 @man4toman
3 years ago

Thanks @netweb,

That makes sense, we've done it before in https://wordpress.org/plugins/wp-parsidate/.

But we will try to solve this kind of problems later for RTL locales in WordPress core.

Last edited 3 years ago by man4toman (previous) (diff)
Note: See TracTickets for help on using tickets.