Skip to content
Back to blog
Production note•Oct 23, 2026

Handling Persian and English in the same interface

Separate language, text direction, and formatting so bilingual screens remain readable through real workflows.

AccessibilityInternationalizationUXProduct

The translated screen is only the beginning

A Persian dashboard can contain an English company name, an email address, a tracking reference, and a Persian support message in the same row. Translating the labels does not tell the browser how those values should behave together.

The problems tend to surface during real work: punctuation appears on an unexpected side, a reference becomes difficult to scan, or a language switch drops the user back at the homepage.

Treat bilingual behavior as part of the workflow design. The locale influences the surrounding interface, but each piece of content still has its own language and direction.

Declare language and direction separately

lang identifies the language of text. dir establishes its base writing direction. Set both on the document, and override them around content that differs from the surrounding page.

An English article can remain English inside Persian navigation:

<html lang="fa" dir="rtl">
  <body>
    <nav aria-label="ناوبری اصلی">...</nav>
    <article lang="en" dir="ltr">
      <h1>Planning a maintainable first release</h1>
      <p>The article remains readable in its original language.</p>
    </article>
  </body>
</html>

W3C guidance explains both language declarations and structural direction. A right-aligned paragraph alone does not establish the same directional behavior as dir="rtl".

Isolate values that can run in another direction

For user-supplied names with an unknown direction, a bdi element can isolate the value from adjacent text. For a reference with a known Latin format, declare that direction explicitly.

<p lang="fa" dir="rtl">
  درخواست <bdi dir="ltr">REQ-2048</bdi> برای <bdi>Alex رضایی</bdi> ثبت شد.
</p>

This keeps a value's directional behavior from spilling into its neighbors. W3C's inline bidirectional markup guide describes these cases. Automatic direction uses the first strong directional character, so it is a useful default for unknown text rather than a guarantee of the writer's intent.

Apply the same thinking to inputs. A message box may accept either language and benefit from dir="auto". A field intended for a Latin reference can have dir="ltr" while its visible label stays Persian. Keep accessible labels intact when adjusting direction.

Let layout follow meaning

Use logical CSS properties for spacing and alignment that should follow the reading direction:

.request-summary {
  padding-inline: 1rem;
  border-inline-start: 2px solid currentColor;
  text-align: start;
}

These properties describe relationships to the writing direction; MDN's logical properties guide explains the mapping. Review icons individually. A reading-order arrow may need to change direction, while a logo or playback symbol may need to retain its shape.

Keep DOM order meaningful for keyboard and assistive technology users. Visually reversing a row does not automatically create a coherent focus sequence.

Make formatting decisions explicit

A translated date label still needs a policy for calendar and timezone. For a meeting, decide which timezone the displayed time represents and show that context. Choose the calendar deliberately when the product requires consistency across languages; do not assume a locale change is only a change of month names.

For example, Intl.DateTimeFormat accepts locale, calendar, and timezone options. Keep a shared meeting instant in storage, then format it for display. A date-only deadline needs its own date semantics rather than being treated as a midnight meeting.

Review a journey in both languages

Open a filtered queue, inspect a record with mixed text, trigger validation, save a change, and switch language. Check narrow screens, long names, empty states, and keyboard navigation.

The language switch should preserve the equivalent destination where one exists, with a clear fallback otherwise. Confirm whether any unfinished draft survives before offering that switch during editing.

A bilingual interface succeeds when the user can complete the same task with the same understanding in either language. Translated labels matter; the behavior surrounding them makes the translation useful.

Facing a similar problem in your product? Let’s discuss your situation and the work you need.