DEV Community

Discussion on: Adding a lang attribute to your Next.js site

Collapse
 
thatafro profile image
Méhluli Hikwa

Here is another way you could do it, by adding i18n in next.config.js
This helps if you have multi/tones of pages.

module.exports = {
...

i18n: {
    locales: ["en"],
    defaultLocale: "en",
},

...
Enter fullscreen mode Exit fullscreen mode

}

Collapse
 
dawkaka profile image
Yussif Mohammed

Yeah, it works.
But remember to restart the server otherwise you won't see the effect.