Changing the layout direction of text
In this video we talk about the way to change the fllow of langauge. For the most of you this isn't very relevant but for many of the non latin speakers it is. By the end of this video you will know to to change the flow of a segment of copy or all the copy on a page from Right to left(RTL) to LTR(Left to right).
Video Transcript
00:00Life as a programer
00:02Saying a joke for a second time, as the first time the recording didn't work.
00:09It was a really good joke
00:10So we are going to do it anyways
00:12I think it was a good joke, my mom didn't laugh
00:14So... Some times as a programmer, life can get boring.
00:18How about we spruce it up with some bi-directional overrides.
00:24I bet their laughing right now... or at least smiling.
00:29Enjoy that... That's what I wanted to talk about today... kidding... so...
00:33Bi-directional overrides - if you speak only a Latin based language
00:39That goes left to right
00:41I have a surprise for you, there are languages that go in different directions.
00:46Up down. right to left (RTL), and so forth.
00:51Mom: Like Hebrew and Arabic Ben: Exactly!
00:53Exactly these languages are RTL languages.
00:57These type of languages need to change the way copy flows on a page.
01:02Instead of it flowing from LTR(left to right), They need it to flow from RTL.
01:08So let's see how it's done.
01:10You can use this for effects as well.
01:12In this example, for example, we just want to override this paragraph.
01:17The way you would override the paragaph
01:19you would just wrap it around with the BDO tag
01:21BDO- Bi-directional override
01:24And we will override the default functionality that currently is from LTR.
01:29And we want to make it RTL
01:31I'm going to first wrap around the paragraph This is the block we want to control.
01:35Next step, I will add a new attribute
01:37I'll add the dir attribute and assign the value of RTL in it.
01:46I can go input as the value RTL or LTR.
01:51When i save the change and go to a browser
01:55You will see that our copy is now flowing in the other direction.
02:13You might want to use this for an effect as well.
02:22One more thing that i wanted to say, that isn't officially written as far as i can see.
02:26But something that is commonly known, for people that program in those languages
02:30Is sometimes you want to override the whole page.
02:33To override the whole page, you don't need to use the BDO tag
02:36Instead of that add to the body itself the DIR property and change the direction.
02:44Once you do that and you go into your browser
02:46and click on refresh, you will see that every single element in our page is
03:03going to render itself RTL
03:05and i'll punch my mic one last time
03:07for this video
03:11cool... {giggle)...
