journal ·
When a page reads from right to left
Arabic is read from right to left, so its pages are not only translated; they are turned around.
One attribute at the top
Of the sixteen languages on this site, Arabic is the only one that is read from right to left. Every Arabic page says so once, with a direction attribute on the page itself, and the browser does the rest of the work. Text starts at the right edge, lines wrap from the right, and punctuation lands where an Arabic reader expects it. Nobody has to place anything by hand.
Start and end, not left and right
A page only turns around cleanly if its spacing was never written in terms of left and right. In the stylesheet, the skip link at the top of the page sits at the start of the line. The vertical bar beside a quotation is a border on the start side of the block. The note that marks a machine translation carries its accent on the start side too. In an English page the start is the left edge, and in an Arabic page it is the right edge, so one stylesheet serves both and there is no second copy to keep in step.
The things that move the other way
Some details need a rule of their own. When you point at an entry in the list, the card slides a few pixels along the direction of reading, toward the end of the line. In English that is to the right, and in Arabic it would look wrong if it went the same way, so the Arabic pages slide it to the left. It is a small motion, and it is also switched off for anyone who asks their device for less movement.
The things that never flip
The ipe() logo and the signature in the footer always read left to right, because they are a name and not a sentence. So do lines of code, such as the key ipe_lang that appears in other entries. They are marked as isolated runs of left-to-right text, which keeps the surrounding Arabic from scrambling the order of their characters. Without that mark, a line that mixes two directions can end up with its brackets on the wrong side.
Looking at it
The Arabic pages are checked at phone widths like all the others, because that is where a forgotten left-aligned rule shows up first: a margin on the wrong edge, a button pushed against the wrong side. The aim is modest. A reader of Arabic should never feel that the page was built for someone else and then mirrored as an afterthought.
ipe(); // be still
Direction is part of how a language is read, and a page that respects it is quiet in the right way.