* - Lang - Improper handling of text directionality

What the issue is

Content in languages that are read right-to-left (RTL), such as Arabic and Hebrew, or those that may use vertical text directions, requires HTML elements to correctly manage text directionality. This includes using the dir attribute appropriately on elements or through CSS to ensure text is correctly aligned and read in its intended direction. Failure to do so can result in text that is difficult to read, comprehend, or interact with effectively.

Why this is important

Proper handling of text directionality ensures that content is accessible and usable for all readers, especially those whose languages are not written in a left-to-right (LTR) script. It affects the reading flow, visual layout, and navigation of web content, making it crucial for readability and comprehension.

Who it affects

This issue primarily affects:

  1. Users of languages that are read right-to-left or have complex script directions.
  2. Users with cognitive or reading disabilities who rely on consistent, predictable text alignment and direction for comprehension.

How to remediate the issue

  1. Use the dir attribute on HTML elements to specify text direction as needed. This can be set to "ltr" (left-to-right), "rtl" (right-to-left), or "auto" (lets the browser determine the direction based on the content).
  2. Incorporate CSS properties like direction and unicode-bidi for finer control over text direction and embedding.
  3. Test web pages with RTL and vertical text content to ensure that text direction is correctly implemented and does not interfere with the usability and accessibility of other page elements.

Additional resources on handling text directionality in web content can be found at W3C Internationalization: Inline Markup and Bidirectional Text in HTML.

Ticket category