About next-intl-add-language
A guide for developers adding a language to a Next.js project that uses next-intl. It identifies the translation files and app configuration points that need updating.
Key features
- 01Translate en.json entries
- 02Update routing and middleware
- 03Add language-toggle option
Use cases
- 01Adding a complete language translation
- 02Registering a language in app routing
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ github/ awesome-copilot --skill next-intl-add-languageAfter installing, type/next-intl-add-languagein Claude Code to confirm it loaded.
Details
From the project READMEThis is a guide to add a new language to a Next.js project using next-intl for internationalization,
- For i18n, the application uses next-intl.
- All translations are in the directory
./messages. - The UI component is
src/components/language-toggle.tsx. - Routing and middleware configuration are handled in:
src/i18n/routing.tssrc/middleware.ts
When adding a new language:
- Translate all the content of
en.jsonto the new language. The goal is to have all the JSON entries in the new language for a complete translation. - Add the path in
routing.tsandmiddleware.ts. - Add the language to
language-toggle.tsx.
Comments
Markdown supported