DocsComponentsTemplatesThemesGitHub

Languages and right-to-left

Translate the built-in text, format dates and numbers for a locale, and mirror the layout.

Use it

import { LocaleProvider } from '@fruit-labs/design';

<LocaleProvider
  locale="ar"
  dir="rtl"
  messages={{ 'Next page': 'الصفحة التالية', 'Remove {name}': 'إزالة {name}' }}
>
  <App />
</LocaleProvider>

How it works

  • The key of each message is the English text the component shows. Untranslated keys stay English.
  • {name} and {n} are replaced with values.
  • Text you pass as props, such as labels and options, is yours to translate.
  • locale sets month names, weekdays, dates and number formats. Calendar weeks start on Monday.
  • Layout follows dir. Charts, code and one-time codes stay left-to-right.
  • No translations are bundled.