Gutenberg: When the interface is RTL, should code editors also be RTL?

Created on 7 Aug 2018  路  6Comments  路  Source: WordPress/gutenberg

Over the course of some testing, I noted that Gutenberg isn't being consistent with the way it treats code when the interface language is RTL.

If you edit a block as HTML, it reads right-to-left:

screen shot 2018-08-07 at 3 17 13 pm

The Code block also reads right-to-left:

screen shot 2018-08-07 at 3 19 03 pm

Meanwhile, the code in the Custom HTML block reads left-to-right:
_(The visual issue below has been filed separately in #8680)_

screen shot 2018-08-07 at 3 19 48 pm

I'm not fluent in any languages that read right-to-left, but my guess is that we should be consistent about this one way or another. Can someone clarify which we should use?

Thanks!

Needs Decision [Feature] Blocks [Status] In Progress [Type] Question

Most helpful comment

Code for RTL locales should read LTR.

There are some screenshots in #WP44053 that highlight when and where code should be LTR for RTL locales.

All 6 comments

Code for RTL locales should read LTR.

There are some screenshots in #WP44053 that highlight when and where code should be LTR for RTL locales.

Thanks for including that thread, @ntwb 鈥斅爐hat's helpful. It sounds like the examples I included above should be LTR in RTL locales then.

One more clarifying question: In the other thread, you noted:

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.

In the case of Gutenberg however, we call the "Text" editor the "Code" editor. It currently reads RTL in RTL locales. Should that be LTR as well?

In the case of Gutenberg however, we call the "Text" editor the "Code" editor. It currently reads RTL in RTL locales. Should that be LTR as well?

Yes, I think it should be, here's a screenshot of it from https://he.wordpress.org/gutenberg/

screen shot 2018-08-09 at 5 18 31 pm

cc: @yoavf

It's tricky. Once you start adding RTL text (i.e in Hebrew), then editing it while in LTR mode becomes very difficult.

That's just how the mix of ltr HTML code and RTL text works.

The way it's solved n the classic editor is by adding a text direction button to enable users to quickly switch between directions. cc @azaozz

Can someone clarify for me what action needs to be taken here for this issue to be closed?

Another instance of this is when you chose "Edit as HTML" for an individual block in an RTL context:

Screen Shot 2019-11-07 at 10 11 05
Screen Shot 2019-11-07 at 10 15 03

Was this page helpful?
0 / 5 - 0 ratings

Related issues

moorscode picture moorscode  路  3Comments

mhenrylucero picture mhenrylucero  路  3Comments

wpalchemist picture wpalchemist  路  3Comments

spocke picture spocke  路  3Comments

nylen picture nylen  路  3Comments