If you try to write in Hebrew, Kurdish (Sorani), Persian/Farsi, Aramaic, Azeri, Dhivehi/Maldivian, Urdu or Arabic you might want to read this post. My primary language is Indonesian, English is my second, and recently I’m learning Arabic. Indonesian and English are written in the same direction and that is left to right (ltr), but Arabic is different, it is written from right to left (rtl). While learning arabic, I tried to make a post and quoting some arabic texts in my post, here is how I write RTL language in my post…
π Contents
Auto Detection π
I found it strange when I write arabic text, sometime it aligned to right, sometime to the left. After debugging, I think the WordPress.com web reader will automatically align text to the language in the post, when the post is considered using rtl language it will add direction properties to the container.
As you can see in the image when it detected as RTL language the post story content block adding direction
and style
attribute to the element and filling the style attribute with direction
and text-align
properties.
direction=rtl, {direction: rtl} & {text-align: right} π
I don’t know the HTML attribute for direction
and after I check it does nothing, so I will refer to dir
HTML attribute. FYI, this attribute will give the element styles
element { direction: rtl; unicode-bidi: isolate; }
I will just leave the dir
attribute because I’m not using it, this is just for additional information.
From the picture above I decide that I will only use the style direction: rtl;
because the result is what I needed. There are a lot of technical things to deal with the rtl like unicode-bidi, but for now I’m happy enough with just that appearance. The period symbol on the div
with the style direction: rtl;
appear in the most left compared to the text-align: right;
, so in my opinion you can ignore other attributes or properties. Now we can move on and make it real.
Quoting Inline and Block RTL π
As I was complained before about the difference view between reader, site, or mobile apps appearance I need to prepare classes and inline styles. In an inline view, I will need DayPicker--ar
class which has the property direction: rtl;
. In addition, you can add another class formatted-header__title
to make the font size bigger font-size: 24px;
because it appear pretty small compared to the English letters. For the inline element you can use span
.
For the block view, I have some additional styling because I want it to appear more interesting than other parts.
It has different classes with the inline term-tree-selector
for border style and notice__content
to add more margin and padding. I used h1
for the rtl text part because I want to make the font even bigger than just 24px, probably. I separate the meaning with hr
which is horizontal line.
Or you can just make the block rtl simpler with changing span
into div
from the inline.
Now I’m wondering why some languages is written right to left or left to right, or even why there are so many languages. I hope that my experience can help you if you had difficulties with writing RTL text.
Ψ§ΩΨ³ΩΩΩΩΨ§Ω Ω ΨΉΩΩΩΩΩΩΩΩ Ω (assalamu ‘alaykum) means “peace be upon you”. When a muslim meet his/her brother/sister on the way, he greet him by saying this sentence or at least this is how I’ve been taught since I was little as a muslim kid. I’d like to greet you also in Islamic way because I’m planning on filling this blog with posts about Islam.Β [β¦]
Good job! I thought Arabic is a very difficult language to learn. My best friend had been working in Saudi Arabia for about 5 years and she never even learned how to speak the language.π
LikeLiked by 3 people
Thank you π
What a brave girl! We can learn anything by chance and intention, I guess.
LikeLiked by 3 people
Youβre welcome. Youβre right, we can learn anything if we set our minds to it.π
LikeLiked by 3 people
Are you on insta?
LikeLiked by 3 people
Yes, https://www.instagram.com/lyeyuu/, instagram right? π
LikeLiked by 1 person
You don’t have post there
LikeLiked by 3 people
Yes, I don’t currently have good image to post π , probably later
LikeLiked by 2 people
Followed as well as likedππππ€
LikeLiked by 3 people
Read your post now..π
It’s nice that you’re learning Arabic (coz I’m too lazy to learn any new lang, lolπ). I know, learning any new language requires a lot of dedication and I respect you for that. Anyways, All the best..π
LikeLiked by 3 people
So I guess the good nite is off π
Really no pressure! Me too love my bed β€οΈ
It’s 9.40 pm now here, I’ll back to the another comment tomorrow, I just afraid to say something stupid because of my brain is not on working time π€£
Thank you very much for bringing back my day β€οΈ
LikeLiked by 2 people
Okay..π
It’s 9.00 pm here now.
Okay okay, then there’s no need to replyπ€π..
You’re welcomeπ
Good nightππ
LikeLiked by 3 people
I also tried to learn arabic but… Cnt, lol. It was really tough, will try again in upcoming holidays
LikeLiked by 3 people
No worries, for me it depends on the intention and let the magic happen even only a little work. I would love to hear about your progress. Thank you for visiting π
LikeLiked by 2 people
My pleasure!
LikeLiked by 2 people
Nice read!
A new blogger getting my foothold here, but not a rookie at writing. Just published by 3rd post today. Pls do visit my blog. Would be pleased to know your views.
LikeLiked by 3 people
Thank you so much π
Surely will do, but I need to warn you that I’m not a good reader
LikeLiked by 3 people
Ha ha
LikeLiked by 2 people
ππ
LikeLike
Thanks for your like of my post; you are very kind.
LikeLiked by 3 people
The pleasure is mine π
LikeLiked by 2 people
Thanks for your kindness.
LikeLiked by 2 people
Interesting!!!
LikeLiked by 2 people
I know right! there are so many things that I can learn, this one included! Thanks btw π
LikeLiked by 2 people
π
LikeLiked by 2 people
You are an interesting person. I plan to read more of your previous and future posts! Nice connecting with you!
LikeLiked by 1 person
You know what? super nice comment like yours will be my fuel to write more! Me too really happy to know you!
LikeLiked by 2 people
Please keep writing! Your posts are insightful.
LikeLiked by 2 people
I will! as long as you keep reading, hahaha
LikeLiked by 2 people
π, will always do!
LikeLiked by 2 people
ππ
LikeLiked by 2 people
Right to left very good block
LikeLiked by 2 people
Hahaha, thank you π
LikeLiked by 1 person
I will be busy today because Iam going do a ako with my mum and dad in halsham sports hall
LikeLiked by 1 person
Quite interesting
LikeLiked by 2 people
Thank you π
LikeLiked by 1 person