Right-to-left accessibility
This page is for administrators, designers and developers in public bodies that serve communities in right-to-left
languages. Direction and language are accessibility matters: a screen reader reads Arabic text with the wrong voice
if lang is wrong, and punctuation jumps to the wrong end if direction is not isolated. The facts below come from
Right-to-left languages in the administration.
Contents
- Where the direction comes from
- In the administration
- In content
- In your public design
- Testing
- Related pages
Where the direction comes from
The only source is the locale file: share/locale/<locale>.ini, [LanguageSettings] TextDirection=rtl; 43 locale
files carry it. Templates can ask $site.text_direction, or a locale's is_right_to_left.
In the administration
- When the interface language is right to left, every administration pagelayout writes
dir="rtl"on<html>; side columns change places and directional icons point the other way. - Names typed by editors (node names, user names) are isolated with
dir="auto"or<bdi>where the administration inserts them into its text, so mixed-direction text keeps its punctuation in place. - A left-to-right page is unchanged, byte for byte.
- Held by
tests/tests/design/AdminRightToLeftTest.php; the project counts this under WCAG 1.3.2 Meaningful sequence (Accessibility standards).
In content
Independent of the interface language, text in a right-to-left content language carries lang and dir="rtl"
where it is shown and edited:
design/standard/templates/parts/exp_content_direction.tplprintslang="he-IL" dir="rtl"(for example) for a right-to-left content locale; your design can include it;- the edit forms of the standard, admin, admin4 and AdminUI designs;
- the online editor switches its direction (TinyMCE 3 and 8
directionality, the tiptap editor'scontentDirection).
Content languages themselves are set up as described in Content languages.
In your public design
- Write
langanddiron<html>from the siteaccess locale, as the administration does. - Use CSS logical properties (
margin-inline-startrather thanmargin-left) so one stylesheet serves both directions. - Include
parts/exp_content_direction.tplwhere content of another direction appears inside a page (a quotation, a translated summary). - Mirror directional icons (arrows, chevrons), not logos or media controls.
- See Right-to-left sites for the builder's view.
Testing
- Switch the interface language of a test user to a right-to-left language and use the main editing tasks.
- On the public site, check each right-to-left siteaccess with a screen reader set to that language: the voice must
change with
lang. - Check mixed text: an English name in an Arabic sentence, a phone number, a date.
Related pages
- Right-to-left languages in the administration
- Content languages
- Languages
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.