Fundamentals

Bidirectional Text (Bidi)

Mixed left-to-right and right-to-left text in the same content.

Definition

Bidirectional text (bidi) occurs when content mixes left-to-right (LTR) and right-to-left (RTL) scripts in the same text. For example, Arabic text containing English words or numbers. The Unicode Bidirectional Algorithm (UBA) handles display order automatically, but developers may need explicit directional controls for complex cases. Proper bidi support is essential for RTL languages.

Examples

  • Arabic with English: 'مرحبا Hello' - mixed directions
  • Numbers in RTL: Phone number 555-1234 in Arabic text
  • Embedded quotes: English quote in Hebrew paragraph
  • Brand names: 'Nike' in Arabic product description

Frequently Asked Questions

How does the browser handle bidi text?

Browsers use the Unicode Bidirectional Algorithm (UBA). It analyzes character types and determines display order. Most cases work automatically. Use dir attribute and bdi/bdo HTML elements for edge cases where algorithm gets it wrong.

What are common bidi issues?

Issues: 1) Punctuation appearing on wrong side 2) Numbers reversed 3) Embedded LTR text misplaced 4) Parentheses/brackets mirrored incorrectly. Fixes: Use unicode control characters (LRM, RLM) or HTML dir attribute to give hints.

Related Terms

Ready to simplify your i18n workflow?

Start managing translations with IntlPull.

    Bidirectional Text (Bidi) - Definition & Examples | IntlPull Glossary | IntlPull