Components
Locale Provider
The language for everything inside: how dates, numbers and money read, and every word components show or announce. Without it, "en-US" and English.
Import
import { LocaleProvider, useLocale, useMessages, ENGLISH } from '@rinzai/zen';Examples
Right to left
Right to left: set dir="rtl" on the page (or any part of it). Layout, arrow keys and arrows follow; LocaleProvider gives the locale and words.
| س | ح | ن | ث | ر | خ | ج |
|---|---|---|---|---|---|---|
API reference
<LocaleProvider>
The language for everything inside: locale formats dates, numbers and money and picks month and weekday names and the week's first day (a component's own locale prop still wins), and messages replaces any of the words components show or announce (see ENGLISH for them all; the rest stay English). Without it, components use "en-US" and English. Nest one to change part of the page.
| Prop | Type | Default |
|---|---|---|
localee.g. "en-IN", "fr-FR". Defaults to the enclosing provider's, or "en-US". | string | — |
messagesAny of the words to replace; the others are kept. | Partial<{ clear: string; cancel: string; close: string; dismiss: string; delete: string; remove: (item: string) => string; noResults: string; search: string; expand: string; collapse: string; minimum: string; ... 107 more ...; notifications: string; }> | — |