All insights

Building Bilingual Arabic and English Websites with Laravel

Going bilingual is more than translating strings. Routing, right-to-left layout, typography, SEO and editorial workflow all need to be designed together from the start.

By Amir Nassar4 min read
Table of contents

For companies serving Egypt, the Gulf and international customers, a single-language website leaves money on the table. A bilingual Arabic and English site reaches both audiences, but it also multiplies the number of things that can go wrong. This article covers the engineering decisions we make when building bilingual Laravel applications, based on projects such as the bilingual Enseval corporate site and the Inngez studio management system.

Decide how locales appear in URLs

You have three common options: a prefix such as /ar/about, a subdomain such as ar.example.com, or a separate domain per language. For most businesses the prefix is the simplest to operate and the easiest for search engines to understand. Whichever you choose, keep it consistent and make every page available in both locales at predictable addresses.

Route::prefix('{locale}')
    ->where(['locale' => 'en|ar'])
    ->group(function () {
        Route::get('/about', AboutController::class)->name('about');
    });

Add a small middleware that reads the locale from the route, sets it with App::setLocale(), and falls back to a default when it is missing or invalid. Redirect the bare domain to the right language based on a stored preference or the browser's accepted languages, but always let visitors switch manually.

Right-to-left is a layout system, not a stylesheet patch

Arabic reads from right to left, and the whole interface should mirror, not just the text. Set dir="rtl" and the language attribute on the root element, and design with logical properties instead of left and right. Tailwind CSS supports logical utilities such as ms-4 and ps-4, which flip automatically with direction, so you maintain one set of components rather than two.

Test the details people forget

  • Icons with direction, such as arrows, chevrons and progress bars, must flip.
  • Numbers, phone numbers and Latin product names inside Arabic text need correct bidirectional handling.
  • Form fields, tables and date pickers should be checked in both directions.
  • Email templates and PDF invoices need the same attention as the website.

Typography matters more than you expect

Choose a typeface with a well-designed Arabic set, and match its weight and size to the Latin one so mixed pages look balanced. Arabic often needs slightly larger sizes and more generous line height than Latin to remain comfortable to read. Load only the font weights you need, and use font display settings that avoid a long invisible-text delay on slow connections.

Keep translations organised

Laravel supports both PHP array files and JSON translation files. A good rule is to use JSON keyed by the English phrase for short interface labels, and structured keys for longer, contextual text. For content that editors manage, such as blog posts and service pages, store translations in the database rather than in files so that non-developers can maintain them from a dashboard.

Plan for plurals and variables

Arabic has more plural forms than English. Laravel's pluralisation helpers accept rule sets for each form, so write messages with variables and choose the plural form through the framework, not through string concatenation.

SEO for two languages

Search engines need clear signals about which page is which. Give each language its own URL, add hreflang link tags that point each page to its counterparts, and include a canonical URL on every page. Translate titles and meta descriptions, not only the body, and list both versions in your sitemap. Do not auto-redirect crawlers based on their location, because that can hide one version from indexing.

Build an editorial workflow that scales

The hardest part of a bilingual site is not code, it is keeping both versions up to date. Decide who owns translation, how missing translations are displayed, and what happens when the source text changes. A useful approach is to show a clear fallback to the default language rather than an empty page, and to flag translated content that is older than the source so editors can review it.

A checklist before launch

  1. Every public page exists in both locales with a language switcher that keeps the visitor on the equivalent page.
  2. The layout mirrors correctly, including forms, tables and icons.
  3. Titles, descriptions, structured data and sitemaps are translated.
  4. Emails, validation messages and error pages are translated.
  5. Dates, numbers and currency follow the user's locale, with the Egyptian pound shown clearly where relevant.
  6. Editors have a way to see and fix missing translations.

Building both languages together from the first sprint is far cheaper than bolting Arabic on later. If you are planning a bilingual website or platform, see our projects for examples, explore our services, or talk to Narmar about your requirements.

Share this article

Planning something similar?

Tell us about your project — we reply within one business day with next steps and an honest estimate.

Talk to our engineers

Get the next insight in your inbox

Practical notes on software, AI and ERP for growing businesses. No spam — unsubscribe in one click.

  • Laravel
  • Backend
  • Security

Securing a Laravel Application: A Practical Checklist

Laravel ships with strong defaults, but secure applications still need good habits. Use this checklist to review authentication, access control, uploads, secrets and deployment.

4 min read