-2

I cannot find a solid example of using the language tag with Next Head. Here are the two best I've seen. Which one, if either, is proper?

Note: It doesnt have to be dynamic.

Option 1

<Head>
  <meta property="og:locale" content="en_US" />
  ...
</Head>

Option 2

<html lang='en'>
  <Head>
  ...
  </Head>
</html>

Option 3 (capital Html)

<Html lang='en'>
  <Head>
  ...
  </Head>
</Html>
juliomalves
  • 42,130
  • 20
  • 150
  • 146
mango
  • 381
  • 1
  • 5
  • 11
  • Does this answer your question? [How to specify language of website? (HTML?)](https://stackoverflow.com/questions/1071789/how-to-specify-language-of-website-html) – Progman Oct 18 '21 at 18:40
  • 1
    Does this answer your question: [NextJS html \[lang\] missing by default](https://stackoverflow.com/a/66737700/1870780)? Add it in your custom `_document` instead. – juliomalves Oct 18 '21 at 22:37

1 Answers1

1

You can add it to the next.config.js

module.exports = {
  i18n: {
    locales: ['en-US'],
    defaultLocale: 'en-US',
    localeDetection: false,
  },
}
Fedor Chernin
  • 146
  • 1
  • 4