Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useLocaleHead throws "[vue-i18n-routing] Locale ISO code is required to generate alternate link" Error when using locales, lang dir & nuxt module array config style #2617

Closed
lautr opened this issue Dec 13, 2023 · 1 comment · Fixed by #2618
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage v8

Comments

@lautr
Copy link

lautr commented Dec 13, 2023

Environment

@nuxtjs/i18n: 8.0.0-rc.9

  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.8.2
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@9.4.2
  • Builder: -
  • User Config: devtools, modules
  • Runtime Modules: @nuxtjs/i18n@8.0.0-rc.9
  • Build Modules: -

Reproduction

Configure the Module using locales & langdir using the Nuxt Module Config Array style like:

 modules: [
    [
      '@nuxtjs/i18n',
      {
        defaultLocale: 'de',
        langDir: './translations',
        locales: [
          {
            code: 'de',
            file: 'de-DE.ts',
            iso: 'de-DE',
          },
        ],
      }
    ],
  ],

and use useLocaleHead anywhere

Can be reproduced here:

https://github.com/lautr/bug-nuxtjs-i18n

https://stackblitz.com/~/github.com/lautr/bug-nuxtjs-i18n

Describe the bug

useLocaleHead throws "[vue-i18n-routing] Locale ISO code is required to generate alternate link" Error when using locales, lang dir & nuxt module array config style.

Additional context

Can be reproduced here:

https://github.com/lautr/bug-nuxtjs-i18n

https://stackblitz.com/~/github.com/lautr/bug-nuxtjs-i18n

Logs

No response

@BobbieGoede
Copy link
Collaborator

Thanks for reporting and providing a reproduction! This will be fixed after #2618 is merged.

@BobbieGoede BobbieGoede added v8 🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage and removed pending triage labels Dec 13, 2023
kazupon pushed a commit that referenced this issue Dec 14, 2023
* fix: layer inline module options not used in generation

* test: add regression test for #2617
BobbieGoede added a commit to BobbieGoede/i18n that referenced this issue Mar 21, 2024
BobbieGoede added a commit to BobbieGoede/i18n that referenced this issue Mar 21, 2024
BobbieGoede added a commit to BobbieGoede/i18n that referenced this issue Mar 21, 2024
DarthGigi pushed a commit to DarthGigi/i18n that referenced this issue Apr 16, 2024
…#2618)

* fix: layer inline module options not used in generation

* test: add regression test for nuxt-modules#2617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: a bug in an edge case that only affects very specific usage v8
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants