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 havedir=ltr
. Addingdir=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
, andltr
text, defaulting toltr
. - 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)
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.
+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!
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.
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.