Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Website in right-to-left languages (Arabic, Hebrew)

I currently developing a multi-language interface for a Django project. But when I started to work on Arabic and Hebrew languages, I noticed all pages messed up after dir="rtl" to html tag (according to instructions on http://www.w3.org/International/tutorials/bidi-xhtml/)

Does that mean I need separate stylesheets for right-to-left languages?

like image 803
jack Avatar asked Apr 21 '10 00:04

jack


People also ask

Are Arabic websites from right to left?

Languages like Arabic, Urdu, Kurdish, Hebrew, and Persian follow the right-to-left style of script. One of the primary UX considerations for international websites is that the layout can accommodate different styles of language scripts.

Is Arabic a RTL or LTR?

If it's a Hebrew (or Arabic, etc.) character, the element will get a direction of rtl. If it's, say, a Latin character, the direction will be ltr.

What is LTR and RTL?

For example, the en-US locale (for US English) specifies left-to-right. Most Western languages, as well as many others around the world, are written LTR. The opposite of LTR, RTL (Right To Left) is used in other common languages, including Arabic ( ar ) and Hebrew ( he ).

What is HTML RTL?

rtl. Right-to-left text direction. auto. Let the browser figure out the text direction, based on the content (only recommended if the text direction is unknown)


2 Answers

Do not put the style attribute to the html tag.

Use the dir='rtl' attribute only inside the div's where you actually use Arabic and Hebrew. Not for the entire page.

like image 101
Kasturi Avatar answered Oct 09 '22 12:10

Kasturi


What you need to do in addition to adding the dir="rtl" to the tag is flipping your stylesheets. Create an rtl.css stylesheet which will act like a mirror to your default stylesheet. For example. If your style.css has this rule below:

.some-class { margin: 10px 5px 10px 7px; }

In the rtl.css it will be flipped like this:

.some-class { margin: 10px 7px 10px 5px; }

Check this: http://rtl-this.com/tutorial/3-different-ways-rtl-your-css

like image 45
layalk Avatar answered Oct 09 '22 10:10

layalk