next.config.js
module.exports = {
i18n: {
locales: ["en", "ko"], // 지원하는 언어 리스트
defaultLocale: "ko", // 디폴트 값
localeDetection: true, // 언어자동감지 - 기본값: true
},
}
유저가 루트경로로 접근했을 시 넥스트에서는 헤더의 Accept Language 값을 통해 사용자의 locale 을 유추한다. 다만 브라우저마다 표시되는 방법이 다르다.




<aside> 💡 크롬, 웨일, 파이어폭스: ko, ko-KR 엣지: ko 사파리: ko-kr
</aside>
<aside> 💡 > npm i next-i18next // yarn add next-i18next
</aside>
const {i18n} = require("./next-i18next.config");
module.exports = {
i18n,
}
module.exports = {
i18n: {
locales: ["en", "ko"],
defaultLocale: "ko",
localeDetection: true, // 언어자동감지 - 기본값: true
},
};