Blocks / Shell

Language Switcher

Locale dropdown over the locales i18n/routing.ts declares, labeled with each language's own name.

$pnpm exec shadcn add @intelligo/language-switcher

Run it inside an app made by intelligo create. Anywhere else, name the registry and install the base first.

Loading preview…
about this block

Locale dropdown over the locales i18n/routing.ts declares, labeled with each language's own name. Renders nothing in a single-locale deployment, so it is safe to mount unconditionally (e.g. in shellConfig.headerRight). Adding a locale to routing.ts plus a messages directory is the whole job.

yours to edit

No config seam of its own — it follows the app shell and the messages file.

messages/en/language-switcher.json

Everything else is used verbatim; a deployment varies through these files and translations.How seams work →

built from

button, dropdown-menu

npm packages it adds

lucide-react · next-intl

what shadcn add writes · 2 files
Components
  • components/layout/language-switcher.tsx
Actions, config and messages
  • messages/en/language-switcher.json

Ready to try it? Three commands and the app runs against a stub model.