Languages

How Arabic and English work, and how to add a language.

Nuzul is Arabic first: / sends visitors to /ar, laid out right to left. English lives at /en. Every page has a language switch that keeps you on the same page.

Where the words are

What Where
Interface texts (buttons, labels, errors, legal pages) messages/ar.json, messages/en.json
Company name, tagline, about, address Dashboard > Company settings (two fields each)
Destinations and stays: names, summaries, descriptions, house rules, season names Dashboard > Stays (Arabic and English fields)
Documentation docs/ar/*.md, docs/en/*.md

Plural forms use ICU messages, so Arabic gets its six forms: {count, plural, =1 {ليلة واحدة} =2 {ليلتان} few {# ليالٍ} other {# ليلة}}.

Dates are formatted with Intl (ar-OM with Latin digits, en-GB), and prices with the currency of the company, e.g. 45.000 ر.ع. and OMR 45.000.

Right to left

The layout uses logical CSS (ms-, me-, ps-, start-, end-), so it mirrors itself in Arabic. Directional icons (chevrons, arrows) are flipped with rtl:rotate-180. Emails, phone numbers and codes are always shown left to right (dir="ltr"), and guest names and reviews use dir="auto" so an English review reads correctly on the Arabic site.

Adding a language

  1. Add the code to locales in src/i18n/routing.ts, e.g. ["ar", "en", "fr"].
  2. Copy messages/en.json to messages/fr.json and translate it.
  3. Text from the database has Arabic and English columns (nameAr, nameEn, ...). Pages pick one with locale === "ar" ? x.nameAr : x.nameEn. For a third language, add columns in prisma/schema.prisma (nameFr, ...), run npx prisma db push, add the fields to the dashboard forms, and update the pickers. A simple alternative is to show English for every non-Arabic language.
  4. Add docs/fr/ if you want the documentation in that language.
  5. If the language is right to left, add it to isRtl in src/i18n/routing.ts.