For: Full Stack · Member & Coach Dashboard

Languages

Arabic and English, right-to-left and left-to-right, and how to add a language.

Arabic is the default language (right-to-left), English the second. Every address starts with the language: /ar/... or /en/.... The language switch keeps you on the same page.

Where texts live

Kind Where
Interface messages/<lang>/common.json, site.json, member.json, coach.json, merged by src/i18n/request.ts
Content in both languages database columns ending in Ar / En: programs, workouts, exercises, foods, meal plans, plans, groups, challenges, badges, coach titles, gym settings
Content people type posts, comments, messages, notes, check-ins: stored once, shown with dir="auto" so each paragraph takes its own direction
Documentation docs/ar/*.md and docs/en/*.md

Each member and coach also has a preferred language (User.locale) used for emails.

Writing Arabic

The Arabic texts are written for Gulf readers in Modern Standard Arabic, not translated word by word. Numbers use Latin digits in both languages, as most Omani apps and receipts do. Plural rules are handled by ICU messages, e.g. {n, plural, one {...} two {...} few {...} other {...}}.

Right to left

Layouts use logical properties (ms-, me-, ps-, start, end), so they mirror by themselves. Charts run right to left in Arabic, like the text. Arrows that mean "forward" are flipped with rtl:-scale-x-100.

Adding a language

  1. Add the code to locales in src/i18n/routing.ts.
  2. Copy messages/en to messages/<code> and translate the four files.
  3. For content in the new language, add …Fr (for example) columns next to …Ar/…En in prisma/schema.prisma and choose the column by locale where the pages pick ar ? nameAr : nameEn.
  4. Add docs/<code>/ if you ship documentation in it.