next-intl-add-language
작성자: github
next-intl 국제화를 사용하는 Next.js 애플리케이션에 새 언어를 추가합니다. ./messages 디렉토리의 en.json에 있는 모든 항목을 새 언어로 번역해야 합니다. src/i18n/routing.ts의 라우팅 설정과 src/middleware.ts의 미들웨어를 업데이트하여 새 언어를 인식하도록 합니다. 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.