When posting in Google Plus (and other platforms), I noticed that when I type in Persian, which is a right-to-left language, the text direction changes automatically to rtl and text-alignment:right
. However, when I switch to English, the direction switches to ltr and text-alignment:left
. How can I achieve this functionality? Is this related to HTML5 or Javascript? What steps should I take to implement this feature?
Thank you in advance.