Skip to content

fix: respect detectBrowserLanguage: false in SSG plugin#3410

Merged
BobbieGoede merged 4 commits intonuxt-modules:mainfrom
ap-arto:issue-fix
Mar 20, 2025
Merged

fix: respect detectBrowserLanguage: false in SSG plugin#3410
BobbieGoede merged 4 commits intonuxt-modules:mainfrom
ap-arto:issue-fix

Conversation

@ap-arto
Copy link
Copy Markdown
Contributor

@ap-arto ap-arto commented Mar 13, 2025

Do not call detectBrowserLanguage when options.detectBrowserLanguage is set to false

🔗 Linked issue

#3407

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

i18n:plugin:ssg-detect doesn't respect nuxtI18nOptions.detectBrowserLanguage and calls detectBrowserLanguage() regardless if that option is set to false.
And it causes an issue: when we use strategy: 'no_prefix' and differentDomains: true alongside with detectBrowserLanguage: false, locale messages are not being loaded.

📝 Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@ap-arto ap-arto changed the title Fix: do not call detectBrowserLanguage if options.detectBrowserLanguage is set false Fix: do not call detectBrowserLanguage if options.detectBrowserLanguage is false Mar 14, 2025
@BobbieGoede BobbieGoede changed the title Fix: do not call detectBrowserLanguage if options.detectBrowserLanguage is false fix: respect detectBrowserLanguage: false in SSG projects Mar 20, 2025
@BobbieGoede BobbieGoede changed the title fix: respect detectBrowserLanguage: false in SSG projects fix: respect detectBrowserLanguage: false in SSG plugin Mar 20, 2025
@BobbieGoede
Copy link
Copy Markdown
Member

Thank you for contributing! 🙏

@BobbieGoede BobbieGoede merged commit 5f56bba into nuxt-modules:main Mar 20, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants