mcpField
N
next-intl-add-language

next-intl-add-language

github.com/githubDevelopment40.5k9.4k installsUpdated 1d ago
Repository

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

  1. 01Translate en.json entries
  2. 02Update routing and middleware
  3. 03Add language-toggle option

Use cases

  1. 01Adding a complete language translation
  2. 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-language

After installing, type/next-intl-add-languagein Claude Code to confirm it loaded.

Details

From the project README

This 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.ts
    • src/middleware.ts

When adding a new language:

  • Translate all the content of en.json to 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.ts and middleware.ts.
  • Add the language to language-toggle.tsx.

Comments

Markdown supported