Releases: nuxt-modules/i18n
Release list
v10.6.0
This release is mostly about performance, and about making the domain features behave consistently.
Faster builds and faster SSR
Locale messages are no longer bundled into your server build as JavaScript, no longer shipped as client chunks when they are served from the messages endpoint, and no longer copied on every server-rendered request.
Building a Nuxt app with 10 locales of around 2,000 messages each and 10 pages:
| 10.5.0 | 10.6.0 | ||
|---|---|---|---|
| build time | 9.2s | 5.7s | 38% faster |
| peak build memory | 3.6 GB | 2.5 GB | 30% less |
| build output added by the module | 12.9 MB | 3.2 MB | 75% smaller |
| SSR throughput | 785 req/s | 1722 req/s | 2.2× higher |
Median of three runs on an M4 Pro with Nuxt 4.5; throughput over 10 concurrent connections. The same app without the module builds in 3.4s and outputs 3.2 MB.
How much of this you notice depends on how many messages your app loads: a few locales with a few hundred messages each will barely differ, larger message sets gain the most. It covers messages the module can read while building — .json, .yaml and .json5 files. Locale files written as .ts or .js produce their messages at runtime, so both their build and their SSR cost stay as they were. Apps that previously ran out of memory building large message sets should now complete.
This should work without any changes on your side. The new message handling can be turned off with experimental.optimizeMessageBundling: false if you run into trouble — and if you do, please let us know so we can sort it out.
Domains
differentDomains and multiDomainLocales now agree on which locale each domain serves, which URL a locale is advertised on, and where a visitor goes when the locale they asked for lives on another domain. hreflang and canonical links name one domain per locale, so every domain in your setup describes the same set of pages instead of each claiming the languages for itself.
10.5.0 could also stop serving a locale at its own domain root, redirecting / to the prefixed path and returning 404 for unprefixed paths. A domain that serves exactly one locale is treated as that locale's default again, so domainDefault is not needed for it.
Changelog
🚀 Features
- Add
experimental.optimizeMessageBundlingoption - by @BobbieGoede in #4068 (e7b6b) - domain: Restrict locales to a subset of
domains- by @BobbieGoede in #4085 (436c3)
🐞 Bug Fixes
- Strip protocol when matching domain to host - by @adamkasper, @cursoragent and @BobbieGoede in #4064 (86a4d)
- Let vue-router encode
switchLocalePathpaths - by @Vincentdevreede and @BobbieGoede in #4079 (03a8e) - Load locale files that use Nuxt app composables in the app - by @BobbieGoede in #4102 (917c0)
- Keep params encoded when resolving a localized route by path - by @BobbieGoede in #4104 (a4eee)
- bundler:
- Only precompile locale files the resource transform can re-emit - by @BobbieGoede in #4095 (930ff)
- domain:
- Resolve locale availability from host membership - by @BobbieGoede in #4083 (ef5d3)
- Resolve links for the host default locale under
prefix_and_default- by @BobbieGoede in #4087 (de62b) - Resolve domain config the same way at build time and runtime - by @BobbieGoede in #4090 (b38b7)
- Resolve the current origin from the host - by @BobbieGoede in #4103 (01d43)
- Redirect detection to the domain serving the detected locale - by @BobbieGoede in #4105 (03eba)
- Resolve a domain serving a single locale as its default - by @BobbieGoede in #4107 (efb9d)
- Serve every locale on a host matching no configured domain - by @BobbieGoede in #4108 (187b3)
- hmr:
- Use virtual module ids in
import.meta.hot.accept()for vite 8 - by @sawa-ko and @BobbieGoede in #4065 (329db)
- Use virtual module ids in
- routing:
- Resolve the unprefixed locale per domain - by @BobbieGoede in #4082 (7a2db)
- seo:
- Emit the same
x-defaulton every domain - by @BobbieGoede in #4089 (45d95) - Warn when a domain setup has no locale to annotate as
x-default- by @BobbieGoede in #4092 (e0706) - Resolve alternate and canonical links from one domain per locale - by @BobbieGoede in #4106 (21e1c)
- Emit the same
- types:
- Narrow locale head types to support
useHeadSafe- by @BobbieGoede in #4062 (59e5d) - Annotate the logger so its declaration stays portable - by @BobbieGoede in #4094 (93754)
- Prevent duplicate tsconfig paths for aliased deps - by @BuuBux and Kamil Kras in #4031 (d6930)
- Narrow locale head types to support
🏎 Performance
- Skip client locale chunks when using messages endpoint - by @BobbieGoede in #4067 (7d762)
- Keep locale messages out of server build graphs - by @BobbieGoede in #4070 (640e1)
- Avoid copying locale messages per ssr request - by @BobbieGoede in #4071 (46ab4)
- Enable
experimental.optimizeMessageBundlingby default - by @BobbieGoede in #4073 (ba6f3) - Keep message caching enabled for static locales in mixed projects - by @BobbieGoede in #4074 (d9d30)
View changes on GitHub
v10.5.0
✨ Custom paths via definePageMeta() in all modes
Custom paths set with definePageMeta() are now used in all customRoutes modes instead of only in 'meta' mode. If a route has custom paths from multiple sources the definePageMeta() value takes precedence and a warning is logged during build, this makes it possible to migrate from the pages option or the deprecated defineI18nRoute() macro one page at a time.
Route meta is now the canonical source of custom paths at build time, this allows projects and modules to set custom paths on routes they add or change in the pages:extend hook, see Hooks and modules.
🛠️ Under the hood
The logic behind differentDomains and multiDomainLocales now shares a single implementation, we're exploring whether these can be combined under a single config option in v11.
Please try it out and let me know if you run into any issues 🙏
🚀 Features
- Resolve route options from meta in all
customRoutesmodes - by @BobbieGoede in #4022 (39a8b)
🐞 Bug Fixes
- UseRuntimeConfig type signature compatibility - by @BobbieGoede (89b72)
- Derive route resources from route localization - by @BobbieGoede in #4047 (1d378)
- Skip localizing
routeRulesredirect stub pages - by @BobbieGoede in #4048 (af344) - Locale head type compat - by @BobbieGoede in #4055 (ddeaa)
- Skip optimizing dynamic locale files - by @BobbieGoede in #4058 (c1187)
- Validate locale codes to ensure path segment safety - by @BobbieGoede in #4059 (45498)
- seo: Resolve canonical and og:url from the current locale domain - by @BobbieGoede in #4043 (2452a)
View changes on GitHub
v10.4.1
🐞 Bug Fixes
- NuxtLinkLocale custom and slot type definitions - by @BobbieGoede in #3995 (c139a)
- Resolve
bundle.onlyLocalesfrom the first layer that specifies it - by @cernymatej and @BobbieGoede in #4012 (ffd13) - HMR locale messages flash - by @sawa-ko, Copilot Autofix powered by AI and @BobbieGoede in #4010 (91052)
- Skip detection redirect for routes with disabled localization - by @BobbieGoede and Claude Opus 4.8 (1M context) in #4021 (41631)
- Type locale detector file in server tsconfig - by @BobbieGoede in #4023 (89cf5)
- Route argument narrowing with
experimental.typedPages- by @BobbieGoede in #4024 (8564e) - Drop full-path
<NuxtPage>keys forcompactRoutes- by @BobbieGoede in #4025 (04c3b) - Strip base URL from path in SSR locale redirect - by @imlautaro, Claude Opus 4.8 (1M context) and @BobbieGoede in #4000 (3dc3b)
- Pass
strictSeo.canonicalQueriesto runtime head options - by @BobbieGoede in #4026 (5b284) - Use
domainLocalesruntime config inlocalePropertiesandlocales- by @BobbieGoede in #4027 (31fbb) - Derive
og:locale:alternatefrom localelanguagetags withstrictSeo- by @BobbieGoede in #4028 (fa199) - compactRoutes: Strip stale locale param in by-path resolver - by @Togetic in #4015 (cc2f6)
View changes on GitHub
v10.4.0
🚀 Features
- First-class CDN support for lazy-loaded messages - by @Hronom and Claude Opus 4.7 (1M context) in #3976 (e4d6a)
- Experimental prerenderMessages option - by @BobbieGoede in #3991 (8cc7c)
🐞 Bug Fixes
- Prevent silently disabling
experimental.compactRoutes- by @BobbieGoede in #3972 (7789f) - Compact routes prerender handling and router warnings - by @BobbieGoede in #3975 (131a5)
- Prevent redirection to catch-all for unlocalized routes - by @fedetorre and Federico Torresan in #3911 (1cf37)
- Skip path config generation for unlocalized routes - by @tatakaisun in #3993 (66322)
- Warn on missing vueI18n config in builds - by @tatakaisun and @BobbieGoede in #3992 (26345)
View changes on GitHub
v10.3.0
🚀 Features
- Experimental regex routes - by @BobbieGoede in #3957 (07a9b)
- consolidates per-locale route duplication into regex-based routes, significantly reducing the route count in apps with many locales. Opt-in via
experimental.compactRoutes: true.
- consolidates per-locale route duplication into regex-based routes, significantly reducing the route count in apps with many locales. Opt-in via
🐞 Bug Fixes
- Incorrect route group server redirection during ssg - by @BobbieGoede in #3965 (ce7f7)
- Stable locale message endpoint hash - by @BobbieGoede in #3966 (84525)
View changes on GitHub
v10.2.4
🐞 Bug Fixes
- Do not import from
nuxt/schema- by @danielroe in #3925 (f57bb) - Respect trailingSlash on root - by @divine in #3920 (9e504)
- Move
typescriptto dev dependencies - by @BobbieGoede in #3939 (3b0ad) - Add warning for missing domains when multiDomainLocales is enabled - by @DotwoodMedia in #3938 (d9a1a)
- types: Allow mixing string and objects for locale file configuration - by @richex-cn in #3933 (b63d0)
View changes on GitHub
v10.2.3
No significant changes
View changes on GitHub
v10.2.2
🐞 Bug Fixes
- Handle falsy
options.i18ntypes - by @danielroe in #3900 (b8d1c) - Reduce locale server chunks - by @BobbieGoede in #3921 (635b6)
- Type pollution in
shared-imports.d- by @BobbieGoede in #3923 (fb761) - nitro: Redirect without sending response in render hook - by @BobbieGoede in #3922 (4adaa)
View changes on GitHub
v10.2.1
🐞 Bug Fixes
- Skip localized redirection on nuxt error routes - by @ziyoonee, ziyoonee and @BobbieGoede in #3871 (723ee)
🏎 Performance
- Load client-side locale files in parallel - by @okamoai and @BobbieGoede in #3875 (35692)
View changes on GitHub
v10.2.0
🚀 Features
- Configurable message server route prefix - by @BobbieGoede in #3853 (b40fb)
- Experimental
httpCacheDurationoption for server messages route - by @ivanvakulov in #3856 (4a8db)
🐞 Bug Fixes
- Prevent duplicate message requests on hydration - by @BobbieGoede in #3852 (d50fa)
- Support passing localized routes to
localePath- by @BobbieGoede in #3851 (c2309) - Resolve
@intlify/utils/h3by alias - by @BobbieGoede (fcf84) - Missing i18n context during prerender - by @BobbieGoede in #3862 (2b58f)
- server: Prevent double redirect with root-level dynamic routes - by @ziyoonee in #3866 (c2fc5)