Skip to the article
Aniq-UI

Financial DashboardLanguages

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

LanguageAddressDirectionFont
English, the default/enLeft to rightInter
Arabic/arRight to leftNoto 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 /ar when the browser prefers Arabic, and to /en otherwise. src/proxy.ts does 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:

FolderWhat 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:

EnglishArabic
Sign Inتسجيل الدخول
Overviewنظرة عامة
Your Cardsبطاقاتك
Analyticsالتحليلات
Transactionsالمعاملات
UI Componentsمكونات واجهة المستخدم
Settingsالإعدادات
Exportتصدير
Add Transactionإضافة معاملة
Logoutتسجيل الخروج

Add a language

  1. Add its code to the routing

    Add the language code to locales in src/i18n/routing.ts. For example French:

    src/i18n/routing.ts
    locales: ['en', 'ar', 'fr'],
  2. Add its message files

    In each of the eight folders under messages/, copy en.json under the new code and translate the values. Keep every key and every word in curly braces. src/i18n/request.ts loads them by the language code, so every folder needs the file. For the common folder:

    Terminalin dashboard-template-1
    cp messages/common/en.json messages/common/fr.json
  3. Add it to the language menu

    Add it to languageOptions in src/components/LanguageSelector.tsx, with its name, a short label and a flag from country-flag-icons, such as { id: "fr", label: "Français", shortLabel: "FR", Flag: FR } with FR added to the flags import.

  4. 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 in src/app/[locale]/layout.tsx, src/components/calendar.tsx, src/components/themeToggle.tsx, src/features/dashboard/overview/components/CardSection/CardStack/index.tsx and the quick transfer's QuickTransferSheet/index.tsx. For a script Inter does not cover, add a font with next/font in layout.tsx.

Restart yarn dev, or build again, and the new language answers at its own address, here /fr/login.

Stuck on a step?

Find a fix before you start over.

Troubleshooting

Cookie Preferences

We use cookies to enhance your browsing experience, analyze site traffic, and personalize content. By clicking "Accept All", you consent to our use of cookies for analytics and personalized advertising.