logo
RTL support in Flutter and Next.js

Executive Summary: Understanding RTL Implementation for Arabic-English Apps

Building Arabic-English applications involves more than translating interface content. It requires careful handling of right-to-left (RTL) layouts, bidirectional text, numerals, date formatting, typography, navigation, and localisation across the entire application.

This guide explores how Flutter and Next.js handle RTL implementation, including:

  • Layout Direction: Using logical properties such as start and end instead of fixed left and right values.
  • Bidirectional Text: Managing mixed Arabic and English content, numbers, brand names, and punctuation.
  • Flutter Implementation: Configuring localisation, directional widgets, Arabic fonts, and text fields.
  • Next.js Implementation: Managing locale routing, HTML direction, CSS logical properties, and language-specific metadata.
  • Common RTL Issues: Avoiding broken icons, incorrect text alignment, truncation, and formatting inconsistencies.
  • Testing and Maintenance: Validating both language versions through automated checks and native Arabic reviews.

RTL support in Flutter and Next.js requires more than translating an application into Arabic. It affects layout direction, text rendering, navigation, numerals, date formatting, fonts, and user interaction.

For CTOs and engineering teams, the challenge is ensuring that both Arabic and English interfaces behave consistently across every screen and user workflow. Hard-coded left/right values, concatenated strings, and mixed-direction text can create defects that remain hidden during English-only testing.

This guide explains how to approach RTL architecture in Flutter and Next.js, avoid common implementation problems, and test bilingual applications before release.

What Does Arabic-English App Development Involve Beyond Translation?

Bilingual Arabic and English support covers seven engineering areas beyond translated strings: layout mirroring, bidirectional text, numerals and dates, plural rules, fonts, icons, and content and QA. Translation supplies the words. Engineering decides how those words are laid out, ordered, formatted, and tested in both directions.

  • Layout mirroring: the interface flips so the start of each screen sits on the right.
  • Bidirectional text: text that mixes right-to-left and left-to-right runs, such as an Arabic sentence containing an English brand name.
  • Numerals and dates: the digit set and calendar are product decisions applied through locale-aware formatting.
  • Plural rules: English has two forms; Arabic has six categories (zero, one, two, few, many, and other).
  • Fonts: Arabic glyph coverage and correct letter joining.
  • Icons: some carry direction and mirror; others must not.
  • Content and QA: natively written Arabic copy and test passes in both directions.

Treat bilingual support as a layout and text-handling discipline, not a translation task. Arabic app development touches all seven areas, and a gap in any one reaches users as a visible defect. RTL support in Flutter and Next.js uses different APIs for the same underlying model: logical directions, locale-aware formatting, and isolated text.

How Does RTL Layout Work Across Frameworks?

RTL layout works by replacing physical directions (left, right) with logical ones (start, end), so the framework can place content relative to the reading direction. Components anchored to the start edge move to the right in Arabic. Content with physical meaning, such as logos, stays put.

Logical Start And End Instead Of Left And Right

Logical properties are layout settings expressed as start and end, or inline and block, instead of left and right. CSS margin-inline-start and Flutter’s EdgeInsetsDirectional both resolve against the current direction. Use start and end in code, and reserve left and right for things that are physically left or right. Right-to-left app design is mostly this substitution applied consistently.

What To Mirror And What Not To Mirror

  • Back and forward arrows, chevrons, and other directional icons
  • Progress bars and sliders, which fill from the start edge
  • Navigation order, drawers, and leading and trailing actions
  • Text alignment, which should be start rather than left

Do not mirror these:

  • Logos and brand marks
  • Media-play controls, which are commonly left unmirrored
  • Phone numbers, codes and other digit sequences, which read left to right internally

Decide explicitly: chart axes. Mirroring a time axis is a product decision, not a default.

How The Unicode Bidirectional Algorithm Orders Mixed Text

The Unicode bidirectional algorithm decides how mixed-direction text is displayed. In plain words, each character has a direction class, the algorithm splits a line into runs of one direction, and the paragraph’s base direction decides where neutral characters, such as spaces and punctuation, attach. Digits keep their own left-to-right order inside an Arabic line.

In the sentence تم تحديث تطبيق Acme اليوم (“The Acme app was updated today”), the English name stays left-to-right while the Arabic words run right-to-left around it. Trouble starts when punctuation or a number sits at the boundary between two runs.

Isolating User-Generated And Brand Text

Isolating text means rendering a piece of it as its own run, so its direction cannot reorder the text around it. User-generated content, brand names, and codes need isolation because their direction is unknown at build time. On the web, dir="auto" and the bdi element isolate text, as the W3C guidance on the dir attribute explains. Unicode also defines isolate control characters for plain-text contexts.

How to Implement RTL Support in Flutter

In Flutter, text direction comes from the app’s locale: when the locale is Arabic, and the localisation delegates are registered, the framework supplies a right-to-left Directionality. Widgets that use directional APIs follow it. Hard-coded left and right values, physical alignments, and custom painting do not, and the developer must fix them.

For applications targeting mobile, web and desktop, maintaining consistent behaviour across platforms also requires careful architectural planning. Learn more about Flutter cross-platform development and the considerations involved in building applications for multiple platforms.

Arabic Localisation In Flutter: Locale, Delegates And ARB Files

A locale is a language plus an optional region, such as ar or ar-AE, that selects translations and formatting. The Flutter documentation describes generating an AppLocalizations class from ARB files, which are JSON message files per locale. Registering its delegates and supported locales on MaterialApp, as below, also registers the widget-level delegate that gives Arabic its right-to-left direction. Confirm the setup against the current documentation for your version. Teams implementing complex bilingual mobile interfaces can explore our Flutter app development services for custom application architecture, UI/UX, and integration requirements.

dart

MaterialApp(
  localizationsDelegates: AppLocalizations.localizationsDelegates,
  supportedLocales: AppLocalizations.supportedLocales,
  home: const HomeScreen(),
)

ICU Plural Messages For Arabic

An ICU plural is a message written in ICU syntax that selects wording by plural category. ARB files support it, so the Arabic file needs a form for each category the language uses, while English needs only one and other. Never build plurals with a count greater than one; that is English grammar, not a general rule. Arabic localisation in Flutter therefore needs the message layer finished before screens depend on it.

Flutter RTL Support: Directional Widgets And Icons

Flutter RTL support depends on using the directional variants. EdgeInsetsDirectional, AlignmentDirectional, and PositionedDirectional take start and end values and resolve them against the ambient direction, and Row lays out children from start to end.

EdgeInsets.only(left: 16), Alignment.centerLeft, Positioned(left: 0), and TextAlign.left are physical and never move.

dart

Padding(
  padding: const EdgeInsetsDirectional.only(start: 16),
  child: Align(
    alignment: AlignmentDirectional.centerStart,
    child: Icon(Icons.arrow_forward, matchTextDirection: true),
  ),
)

Icon accepts a matchTextDirection flag that mirrors the glyph in right-to-left contexts. Some icons in the Icons class are already defined to match direction, but check each directional icon in both languages instead of assuming.

Custom Painting And Charts

A CustomPainter draws in physical canvas coordinates, so painted charts, progress arcs, and timelines do not mirror. The painter must read Directionality .of(context) and flip its own x-axis, fill direction, and labels. Chart packages differ in direction support, so test the chosen package with Arabic labels.

Text Fields, Input And Fonts

TextField aligns text with the ambient direction, and the bidirectional algorithm orders the text itself. Fields that hold email addresses, URLs, phone numbers, and codes should set textDirection to TextDirection.ltr, while free-text fields keep the ambient direction.

Bundle or select a font with Arabic glyph coverage and check the fallback behaviour for mixed Arabic and Latin lines. Keep letterSpacing at zero for Arabic text, because added spacing can break letter joining.

The Mistake Of Forcing One Direction At The Root

The common structural mistake is forcing one direction at the root, such as wrapping the app in a Directionality widget fixed to TextDirection.ltr or reading direction from a stored flag instead of the locale. That override disables mirroring for every descendant. Derive direction from the locale and override it only for isolated content.

How to Implement RTL Support in Next.js

In Next.js, the developer sets lang and dir on the root HTML element and owns routing and locale handling; the framework does not choose direction from the language. Arabic pages need dir set to rtl, CSS written with logical properties, and per-language URLs and metadata so search engines and users reach the right version.

Next.js RTL support starts at the root layout, which renders the html element and is where lang and dir are set from the active locale. Browsers use dir for base direction and to resolve start and end in CSS.

text

None
// app/[locale]/layout.tsx: locale resolved by your routing code
const dir = locale === "ar" ? "rtl" : "ltr";

return (
  <html lang={locale} dir={dir}>
    <body>{children}</body>
  </html>
);

Locale Routing In The App Router

Locale routing in the App Router usually means a dynamic locale segment at the top of the route tree, with the active locale read from the URL. For applications requiring localized routing, scalable frontend architecture and API integrations, explore our Next.js development services.

The Next.js internationalisation guide describes this routing pattern. Routing, locale detection and message loading remain the developer’s responsibility, whether handwritten or supplied by a library such as next-intl.

CSS Logical Properties

CSS logical properties such as margin-inline-start, padding-inline, border-inline-start and text-align: start resolve against dir, so one stylesheet serves both directions. Physical properties such as margin-left do not flip, and utility classes that compile to left and right behave the same way. An Arabic RTL website in Next.js is ready for review only when a stylesheet audit finds no physical values left.

Choose a font with Arabic coverage and load the Arabic subset if the font provider splits fonts by subset. Check mixed Arabic and Latin lines for size and baseline differences, because the two scripts can look uneven at the same font size.

Fonts And Number Formatting With Intl

Intl.NumberFormat and Intl.DateTimeFormat format numbers and dates for a locale and accept options for numbering system and calendar. The digits a bare Arabic locale tag produces depend on the runtime’s locale data, so set the numbering system explicitly once the product has chosen. Format every number and date through Intl, never through string concatenation.

Metadata, Hreflang And Per-Language URLs

Each language needs its own indexable URL, a translated title and description, and hreflang annotations that list every language version, including the page itself. The Google documentation on localised versions recommends distinct URLs per language and advises against redirecting users automatically based on a guessed language. Offer a visible language switcher and remember an explicit choice. The Next.js metadata API supports language alternates, so declare hreflang per page.

What Commonly Breaks in Arabic-English Applications?

Bilingual apps break in predictable places: strings assembled from fragments, plural logic copied from English, numbers and phone numbers inside Arabic sentences, directional icons, custom-drawn charts, truncation, letter-spacing, exports and search. The table below lists eight failure points, why each happens, and the fix. Most of them survive English-only testing and surface once real Arabic content arrives.

ProblemWhy it happensFix
Concatenated stringsArabic word order, agreement, and plural forms differ, so fragments cannot be rejoinedUse whole messages with named placeholders
Plural formsCode branches on count equal to one; Arabic uses six categoriesUse ICU plurals or Intl.PluralRules with every category
Numbers and phone numbers in Arabic textThe bidirectional algorithm can reorder digits and neighbouring punctuationIsolate the value and format it through Intl
Directional icons, charts and progress barsIcons and canvas drawing use physical coordinatesMirror directional icons; make painters read the direction; fill from start
TruncationLimits were tuned on English; mixed runs clip at the logical endAllow wrapping; size by layout, not character count
Letter-spacingAdded spacing separates letters that should joinSet spacing to zero for Arabic
Exports and emailsPDFs, CSVs and templates sit outside the UI layer and skip direction and fontsSet dir and lang in templates; embed Arabic-capable fonts; test in target clients
SearchOne word can be written with or without diacritics and with letter variantsNormalise stored and query text

Where this goes wrong: a confirmation message built from a count, a noun and a verb fragment compiles in both languages. The Arabic translator receives three disconnected pieces and cannot reorder them or choose the right plural form. Every fragment is correct, and the sentence is still wrong.

Where this goes wrong: an Arabic sentence ending in a Latin-digit order number sits inside an LTR container. The final full stop attaches to the wrong side of the last run, because the base direction does not match the text. The string is correct in memory and wrong on screen.

How to Test an Arabic-English Application

Test an Arabic and English app by running every screen in both directions with real Arabic content, long strings and bidirectional test strings, then changing device language while the app is running. Add automated direction assertions to catch regressions and finish with sign-off from a native Arabic reviewer.

  • Pseudo-locale. A pseudo-locale is a fake locale that transforms English strings, for example by adding accents and padding, to expose hard-coded text and fixed-width layouts before translations exist.
  • Screen-by-screen review in both directions. Cover every screen, dialog, empty state, and error state.
  • Long strings. Test long Arabic and English strings in every container.
  • Bidi test strings. Keep a fixed set: Arabic with an English brand, Arabic with a phone number, English with an Arabic name, text ending in punctuation, and text in parentheses.
  • Device language changes. Switch language at runtime and at cold start, and confirm direction updates.
  • Screen readers. Check VoiceOver and TalkBack for reading order and for the correct language on mixed text.
  • Automated direction assertions. Assert the resolved direction under an Arabic locale in widget tests, assert the dir attribute in browser tests, and add per-direction visual regression checks.
  • Native-reviewer sign-off. A native Arabic reviewer approves the running build.

Review the running app, not the string file. RTL support in Flutter and Next.js stays dependable only when these checks run on every release.

Chat interfaces, such as an Arabic AI chatbot, add streaming text and mixed-direction messages, so each needs its own bidirectional test cases for partial strings.

Should You Build RTL Support from the Start or Retrofit an Existing App?

Design for Arabic and English from the start when the product is new: directional layout code, whole-sentence strings, and locale-aware formatting are easiest to write once. Retrofit an existing app when its layout code already uses start and end values. Rebuild the UI layer when hard-coded left and right values and concatenated strings are spread through the codebase.

For SaaS products, these decisions should also account for scalability, maintainability, and future feature requirements. Explore our guide to Flutter SaaS architecture decisions for more considerations when planning application architecture.

Signs That A Retrofit Will Take High Effort

  • Hard-coded left and right values spread through components
  • Strings assembled from fragments
  • Plural logic written as count checks
  • Fixed-width containers tuned to English text
  • Custom drawing that ignores direction
  • Numbers and dates formatted by hand
  • Images or exports with text baked in
ApproachBest whenMain risk
Design firstThe product is newNeeds Arabic content and a reviewer before the product has either
RetrofitLayout code already uses start and endAuditing every screen; English regressions
Rebuild the UI layerDirection values and string assembly are spread through the codebaseReimplementing behaviour that already works

When To Rebuild The Ui Layer

The rebuild versus maintain decision for a UI layer depends on how many screens need edits to every directional value, and rebuilding becomes the lower-effort path when most do.

Where this goes wrong: a team searches the codebase for left and right and replaces each with start and end. The search finds explicit values but misses fixed-width containers, canvas drawing, hand-built strings, and images with embedded text. The app looks mirrored on the main screens and breaks on the rest.

Planning RTL support in Flutter and Next.js for an existing product starts with a codebase audit. A retrofit takes effort in proportion to the number of screens containing hard-coded direction, not the number of languages added.

Conclusion

Building a bilingual Arabic-English application requires more than adding translations. It requires a consistent approach to directional layouts, bidirectional text, locale-aware formatting, typography, and testing across every user interaction.

Whether you are developing a new product or modernising an existing application, addressing RTL requirements early helps reduce rework and deliver a consistent experience across both languages. Flutter and Next.js provide the foundations, but reliable implementation depends on the architectural decisions behind them.

At iSyncEvolution, we help businesses build scalable web and mobile applications with thoughtful architecture, cross-platform development, and seamless user experiences. If you are planning an Arabic-English application or evaluating your existing RTL implementation, talk to our team about your development requirements.

RTL support in Flutter and Next.js

Frequently asked questions

Does Flutter Mirror The Layout For Arabic Automatically?

Partly. Flutter derives text direction from the locale, and widgets that use directional APIs, such as Row, EdgeInsetsDirectional and AlignmentDirectional, follow it. Hard-coded left and right values, physical text alignment, custom painting, and some icons do not mirror, so the developer must replace or handle them. Run every screen in an Arabic locale to find them.

Does Next.Js Mirror The Layout For Arabic Automatically?

No. Next.js does not set direction from the language; the developer sets dir on the HTML element and writes CSS that responds to it. Logical properties such as margin-inline-start flip with dir, while physical properties such as margin-left do not. Routing, locale detection, and message loading are also the developer’s responsibility.

Should Arabic And English Use Separate URLs?

Yes, for any public content. One URL per language, such as a locale prefix in the path, lets search engines index each version and lets users share links that open in the right language. Add hreflang annotations listing every version, and avoid redirecting users automatically based on a guessed language.

Which Numerals Should An Arabic Interface Show?

The choice between Latin digits (0-9) and Arabic-Indic digits is a product decision, not a technical default. Decide it with the product owner and a native Arabic reviewer, apply it consistently through locale-aware formatting such as Intl, and keep phone numbers, codes, and identifiers in a predictable form. Test the choice with real users.

Do You Need A Native Arabic Reviewer?

Yes. A native Arabic reviewer checks tone, terminology, gendered forms, and how text reads in the running interface, which automated checks and machine translation cannot confirm. Direction bugs, truncation, and joined-letter problems also show up faster to a reader who knows the script. Review the running app, not an exported string file.

Nikhil Shah is the CTO and Co-Founder of iSyncEvolution, an engineering leader who aligns modern technology best practices with long-term commercial success. A veteran of cloud infrastructure and scalable web/mobile solutions, he specializes in building high-performance software environments. Nikhil helps global brands master their technical roadmaps, optimizing both code performance and development economics to fuel growth.

Recommended Blog