Languages
How the dashboard runs in English and Arabic, where every text lives, and what to change to add a language.
The languages that ship
| Language | Address | Direction | Font |
|---|---|---|---|
| English, the default | /en | Left to right | Inter |
| Arabic | /ar | Right to left | Noto Sans Arabic |
Every label, button, chart legend, table heading, form message and page title exists in both languages.
How the language is chosen
- The language is the first part of every address:
/en/dashboard/analytics,/ar/dashboard/analytics. - A visitor who opens
/is sent to/arwhen the browser prefers Arabic, and to/enotherwise.src/proxy.tsdoes this. - The language menu in the header, a flag with its code, switches language and keeps the user on the same page. On a phone it is in the user menu. Language under Settings, Preferences does the same.
Right to left
On /ar, src/app/[locale]/layout.tsx sets lang="ar" and dir="rtl" on the page, so the whole layout mirrors: the sidebar moves to the right, and the cards, tables and menus read from right to left.
The components use logical Tailwind classes that follow the direction, such as ms-2, pe-4, start-0 and text-start. When you add markup, use these instead of ml-*, pr-*, left-* or text-left, or the Arabic page comes out wrong.
Where the texts live
The texts are split by page under messages/, each folder with an en.json and an ar.json:
| Folder | What it holds |
|---|---|
messages/common/ | The header, the sidebar, the date picker, the footer, the colour switcher, and every page's title and description |
messages/auth/ | The sign-in page and the landing page at /en |
messages/dashboard/overview/ | The overview and its widgets, the quick transfer and the notifications |
messages/dashboard/analytics/ | The analytics page |
messages/dashboard/transactions/ | The transactions page |
messages/dashboard/cards/ | The cards page |
messages/dashboard/settings/ | The settings page |
messages/dashboard/ui-component/ | The UI components page |
Change a text
- Change the value in the English file and the matching one in the Arabic file. Keep the keys the same in both.
- A key missing from one file shows its name in place of the text on that language's page.
- Words in curly braces, such as
{theme}, are filled in by the app. Keep them as they are.
The dashboard's own Arabic labels
When you write about the dashboard in Arabic, use the labels it shows:
| English | Arabic |
|---|---|
Sign In | تسجيل الدخول |
Overview | نظرة عامة |
Your Cards | بطاقاتك |
Analytics | التحليلات |
Transactions | المعاملات |
UI Components | مكونات واجهة المستخدم |
Settings | الإعدادات |
Export | تصدير |
Add Transaction | إضافة معاملة |
Logout | تسجيل الخروج |
Add a language
Add its code to the routing
Add the language code to
localesinsrc/i18n/routing.ts. For example French:src/i18n/routing.tslocales: ['en', 'ar', 'fr'],Add its message files
In each of the eight folders under
messages/, copyen.jsonunder the new code and translate the values. Keep every key and every word in curly braces.src/i18n/request.tsloads them by the language code, so every folder needs the file. For the common folder:Terminalindashboard-template-1cp messages/common/en.json messages/common/fr.jsonAdd it to the language menu
Add it to
languageOptionsinsrc/components/LanguageSelector.tsx, with its name, a short label and a flag fromcountry-flag-icons, such as{ id: "fr", label: "Français", shortLabel: "FR", Flag: FR }withFRadded to the flags import.Set its direction and font, if it needs them
Only Arabic is treated as right to left. For another right-to-left language, extend the
locale === "ar"checks insrc/app/[locale]/layout.tsx,src/components/calendar.tsx,src/components/themeToggle.tsx,src/features/dashboard/overview/components/CardSection/CardStack/index.tsxand the quick transfer'sQuickTransferSheet/index.tsx. For a script Inter does not cover, add a font withnext/fontinlayout.tsx.
Restart yarn dev, or build again, and the new language answers at its own address, here /fr/login.