Repository navigation
This release is mostly fixes, along with deprecation warnings ahead of v11 and an experimental option to keep the scroll position when switching locales.
Deprecation warnings
Options and APIs that will be removed in v11 now log a warning when they're used (#4233): during build for options and defineI18nRoute(), and in development for $localeHead(), $getRouteBaseName() and context in the i18n:beforeLocaleSwitch hook. Most of these were only marked as deprecated in the types before, nothing changes in how they behave. The migration guide lists them with their replacements.
Keep the scroll position on locale switch
With a prefixed strategy, switching locale navigates to another route, so Nuxt scrolls to the top of the page. Setting experimental.preserveScrollOnLocaleSwitch: true keeps the scroll position when navigating to the current page in another locale (#4213). If your app has its own scrollBehavior, it needs to check to.meta.scrollToTop as shown in Keep the scroll position. This is opt-in for now and may become the default in v11.
🚀 Features
- Add experimental option to preserve the scroll position on locale switch - by @BobbieGoede in #4213 (73d60)
🐞 Bug Fixes
- Allow disabling
detectBrowserLanguagethrough runtime config on Nuxt 5 - by @BobbieGoede in #4216 (4a32a) - Do not serve route paths of other domains with
no_prefix- by @BobbieGoede in #4218 (c0ee4) - Skip the messages endpoint for locales without files - by @Ice-Hazymoon and @BobbieGoede in #4211 (fbd65)
- Improve
useI18n()error when called outside of a component - by @BobbieGoede in #4220 (d87ca) - Do not overwrite locale cookie on paths without a page - by @BobbieGoede in #4219 (31b89)
- Support pnpm's global virtual store - by @danielroe and @BobbieGoede in #4227 (b3bb2)
- Add the hash in
useSwitchLocalePathafter hydration - by @Maxiemad and @BobbieGoede in #4225 (0062d) - Only warn about an ineffective
compactRouteswhen the project enabled it - by @BobbieGoede in #4232 (fde75) - Warn when deprecated options and APIs are used - by @BobbieGoede in #4233 (fc81a)
- Follow
trailingSlashfor catch-all and compact routes - by @BobbieGoede and @rastuhacode in #4239 (7a5df) - Downgrade
oxc-parserandoxc-transformfor CPUs without BMI2 - by @BobbieGoede in #4246 (291c1) - compactRoutes: Do not remove the
localeparam from the route being localized - by @BobbieGoede in #4226 (88e64) - head: Re-apply i18n params when the same location is entered again - by @Maxiemad and @BobbieGoede in #4224 (1c081)
- nitro: Keep the message compiler when
dropMessageCompileris enabled - by @BobbieGoede in #4228 (6fdda) - types: Narrow locale head meta
contentto string - by @BobbieGoede in #4212 (19e44)
🏎 Performance
- Only declare the
detectBrowserLanguageruntime config schema on Nuxt 5 - by @BobbieGoede in #4222 (79858) - Skip the
SwitchLocalePathLinkhtml scan when no href went stale - by @BobbieGoede in #4244 (393bc) - dev: Read static locale files as server assets - by @BobbieGoede in #4234 (e767d)