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
- Add the code to
localesinsrc/i18n/routing.ts. - Copy
messages/entomessages/<code>and translate the four files. - For content in the new language, add
…Fr(for example) columns next to…Ar/…Eninprisma/schema.prismaand choose the column by locale where the pages pickar ? nameAr : nameEn. - Add
docs/<code>/if you ship documentation in it.