LTR text is displayed wrong in an RTL interface and vice versa

AI-generated summary

LTR text display issue in RTL interface and vice versa

The discussion revolves around the issue of LTR (Left-To-Right) text being displayed incorrectly in RTL (Right-To-Left) interfaces and vice versa. guysoft explains that the user interface language should not affect how language is displayed, and that the expected behavior is for the text to be aligned according to its language direction, regardless of the interface.

simon mentions that the support mixed text direction setting can resolve this issue, but it is not enabled by default on most sites, including try.discourse.org. He also notes that the FAQ, Terms of Service, and Privacy pages are not regular Discourse posts and do not get their direction set correctly even with the setting enabled.

guysoft asks how to test the mixed text direction, and simon responds that it can be tested by joining a site with the setting enabled or by setting up a own Discourse site.

The discussion also touches on the fact that the setting is not enabled in posts, and simon mentions that enabling the setting should automatically set the text direction for all post content based on the language. However, he notes that there is an issue with the text direction of titles not being correctly set.

An update from simon mentions that an old issue causing the text direction of the FAQ, Terms of Service, and Privacy pages to not get set correctly has been fixed.

Hey,
So the issue is that user interface language should not effect how language is displayed.
If you are reading a thread for example in English, but in a RTL language, the English should be aligned to the left, regardless to the interface.
Same goes for reading an RTL language in an English interface.

The is the expected behaviour in all RTL sites.

To give you the idea, I am attaching here an image of the FAQ when viewed from the Hebrew interface.

1 Like

For sites that have enabled the support mixed text direction setting, the text direction of posts will be set based on the language used in the post. See Supporting mixed text directions for more details. This setting is not enabled on try.discourse.org.

Your screenshot brings up a good point though. the FAQ, Terms of Service, and Privacy pages are not regular Discourse posts, so they do not get their direction set correctly even if the support mixed text direction setting is enabled.

4 Likes

Is there a way to test the mixed text direction?
Also is there a reason this is not default?

The setting isn’t enabled by default because it isn’t needed for most sites. Since the text is parsed in the user’s web browser, enabling the setting adds some extra work to the browser. At the moment, the only way to test it out is to either join a site that it’s enabled on, or to setup your own Discourse site and see if it does what you’re looking for.

The setting is enabled on one busy site that I’m aware of, and seems to be working well for its users.

3 Likes

It’s also not enabled in the posts right?

1 Like

If you enable the support mixed text direction setting, the text direction for all post content should get automatically set based on the language. If you have enabled that setting, try refreshing the page to see if that fixes the issue.

Testing this now, I’m finding that the text direction of titles is no longer being correctly set. That used to work:

Interestingly, an old issue that was causing the text direction of the FAQ, Terms of Service, and Privacy pages to not get set correctly has been fixed:

When I tested this in 2018, the text in the box above would have been incorrectly displayed RTL (based on the site’s locale.)

2 Likes