Forem Creators and Builders 🌱

Cover image for [Request] RTL Support
Nabil Tharwat
Nabil Tharwat

Posted on

[Request] RTL Support

I don't know whether this is already a feature on forem's roadmap, I tried searching and didn't find any posts mentioning RTL.

This issue on GitHub describes the problem briefly. I tried to come up with solutions. Those include:

  • Using dir=auto on user-generated content HTML, leaving the whole rendering and processing to the browser. Per the WHATWG HTML Spec, elements by default have dir=ltr. Adding dir=auto will let the browser determine the directionality of an element based on the first character with a strong directionality in that element. This would require no styling changes AFAICT.
  • Adding a boolean where the author specifies the default direction of their article.
  • Using liquid tags to specify bidi, rtl, and ltr text, defaulting to ltr.
  • Allowing HTML rendering in addition to Markdown and Liquid. This is probably too much.
  • Parsing the content on the server and determining the directionality of each element.

Top comments (4)

Collapse
 
coffeecraftcode profile image
Christina Gorton

We have opened a discussion for this feature request in our Github Discussions . If you have any more suggestions or comments for the feature please add them to the new discussion.

Collapse
 
michaeltharrington profile image
Michael Tharrington

+1 for this request. As DEV's community manager, I field a lot of support requests that come in via email. This is pretty highly requested and would be great to offer!

Collapse
 
kl13nt profile image
Nabil Tharwat • Edited

I'm completely willing and open to contributing/working on this feature. The way I see it is that Forem could start with just posts RTL support, so the layout and the website language remains in English, but posts written in RTL languages would display properly. Been hoping for it for quite some time now.

Collapse
 
michaeltharrington profile image
Michael Tharrington

I really appreciate you offering to help here, but unfortunately we don’t have this work scoped for contributors to pick up and have no immediate plans to focus on i18n. While we're considering adding i18n features like RTL in the future, our current focus is on opening up FOSS installations for Forem. Once we’ve done this, we can reassess what features we’re able to offer next!

I really do think this would be a very valuable addition and when the time comes to figure out what we can do next, I’ll be happy to advocate for RTL support + other improvement to i18n features.