1

Trying to specify my language with nuxt,

Result is weird :

<html lang="en" data-n-head="%7B%22lang%22:%7B%22ssr%22:%22en%22%7D%7D"><head>

config is simple but doesnt work :

 head: {
  title: 'test',
   htmlAttrs: {
 lang: 'it',

},

any idea ?

xif
  • 343
  • 1
  • 9
  • 25

2 Answers2

2

Are you possibly using the Nuxt PWA module together? If so, you need to configure the language settings in the PWA module settings as well.

pwa: {
  manifest: {
    lang: 'it',
  }
}


nnak
  • 21
  • 1
0

According to this answer that should work (don't have nuxt at hand to try). Are you exporting it correctly, that's in nuxt.config.js, right?

module.exports = {
  head: {
    htmlAttrs: { lang: 'en' },
    title: 'awesome title',
...
n-smits
  • 685
  • 7
  • 20
  • I tried same problem with module.exports = { head: { title: 'test', htmlAttrs: { lang: 'it', }, – xif Mar 31 '21 at 22:20