I am managing a community website and I am looking to customize the text direction based on the language of the posts.
- For English posts, I want the direction to be LTR with text-align: left)
- For Arabic posts, I want the direction to be RTL with text-align: right.
Platforms like Google+ and Twitter already offer such solutions for posting text in different languages.
I am trying to figure out how to automatically add the direction attribute to each post when it is loaded from the database so that it displays correctly as either rtl or ltr. Any advice on how to accomplish this would be appreciated!