Locale
Locale provider and dictionaries: every Aedis UI component reads its text from here, in English, Portuguese or Spanish.
Proposal for Acme Bistro
- há 2 minutos
- R$ 449,00
- 250.000
Installation
Once per app, set up Aedis UI. The CLI verifies the signed release before writing anything and pins every dependency:
npx @aedis/cli@0.1.0 initImport the theme once in your global CSS, after Tailwind:
app/globals.css
@import "tailwindcss";@import "./styles/aedis-theme.css";Then add the component:
npx @aedis/cli@0.1.0 add locale# pnpm dlx @aedis/cli@0.1.0 add locale · yarn dlx @aedis/cli@0.1.0 add locale · bunx @aedis/cli@0.1.0 add localeProps
| Prop | Type | Default | Description |
|---|---|---|---|
| locale | string | — | BCP 47 tag the app already resolved, e.g. "pt-BR". Drives formatting too. |
| messages | Messages | en | Dictionary: en (built in), ptBR (locale-pt-br) or es (locale-es). |
| useMessages(key, labels) | hook | — | For component authors: a component's strings with the labels prop overriding single entries. |
Security
- Without a provider every component stays in English, so adding it never breaks a page.
- The labels prop still wins over the dictionary for a single string.
- App copy stays in the app (e.g. next-intl); pass its resolved locale here so there is one source of truth.
- Sidebar is a Server Component and does not read the provider: pass label={messages.sidebar.label}.