next-intl-add-language
por github
Añade un nuevo idioma a una aplicación Next.js utilizando la internacionalización de next-intl. Requiere traducir todas las entradas de en.json en el directorio ./messages al nuevo idioma. Actualiza la configuración de enrutamiento en src/i18n/routing.ts y el middleware en src/middleware.ts para que reconozcan el nuevo idioma. Registra el idioma en el componente de alternancia de idioma en src/components/language-toggle.tsx.
npx skills add https://github.com/github/awesome-copilot --skill next-intl-add-languageThis 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.