Repository: nuxt-modules/i18n

Issue #3435: Roadmap to v10.0.0
Created: 2025-03-21T20:54:56Z
With vue-i18n v10 soon entering its maintenance/hotfix-only status, and vue-i18n v12 entering alpha, we have some catching up to do.
Updating vue-i18n to its next major means breaking changes, albeit small ones in vue-i18n v11. We will take this as an opportunity to make some breaking changes in the form of cleanup and reorganization of config options.
Feel free to suggest any changes and please let me know if some change needs reconsidering.

 Drop CJS, go ESM only
 Raise minimum Node version to v20
 Split up v9 (and earlier) documentation, see if we can move it to v9.i18n.nuxtjs.org
 Move typescript to devDependencies - this should cause no issues after updating @intlify/unplugin-vue-i18n but needs to be tested. requires release, may not be possible since next release will be vue-i18n v12 compatible
 Update to Vue I18n v11 (see breaking changes)

 #3526







 Remove migration ease for restructureDir - require a directory name (keep default value 'i18n')
 Drop bundle.optimizeTranslationDirective (#3238)
 Drop experimental.generatedLocaleFilePathFormat (we use hashed virtual files now)
 Strip file/files properties from i18n.options.mjs generated file
 Remove deprecated functionality

 Drop $resolveRoute()
 Drop $localeLocation()
 Drop useLocaleLocation


 Deprecate (remove in v11)

 $localeHead - reason: use-case unclear, useLocaleHead is more flexible and easier to maintain
 $getRouteBaseName - rename to $routeBaseName to be consistent with useRouteBaseName (still under consideration)


 Promoting experimental options

 experimental.switchLocalePathLinkSSR - enable by default
 experimental.hmr - move to hmr
 experimental.autoImportTranslationFunctions - enable by default, move out of experimental (where?)
 experimental.alternateLinkCanonicalQueries - enable by default, consider deprecating (dropping in v11)

Duplicate issue #3238: Nuxt/i18n v9.1.0 breaks Vitest code coverage
Created: 2024-11-19T14:48:07Z
Environment
Nuxt project info:


Operating System: Linux
Node Version:     v18.20.3
Nuxt Version:     3.14.159
CLI Version:      3.15.0
Nitro Version:    2.10.4
Package Manager:  npm@10.2.3
Builder:          -
User Config:      default
Runtime Modules:  @nuxtjs/i18n@9.1.0
Build Modules:    -


Reproduction
You can reproduce the bug with the StackBlitz here : https://stackblitz.com/edit/nuxt-starter-gpaujj?file=package.json
Run the following commands :
npm i
vitest --coverage
Describe the bug
When using Vitest to generate code coverage (with either v8 or istanbul), it appears that v9.1.0 introduces a bug that breaks the generated coverage files and their output.
Observed Behavior:

In the provided reproduction, the generated file coverage/final-coverage.json contains only {}, which is incorrect.
The console output shows no files being covered, even though this is inaccurate.

Expected Behavior:

The coverage/final-coverage.json file should correctly represent the coverage data.
The console output should accurately reflect the covered files.

Temporary Fix:
Reverting to v9.0.0 resolves the issue and restores normal functionality.
Additional context
You can also see that something's wrong one the PR that updates the package on a larger project of mine, with this job : https://github.com/antoinezanardi/werewolves-assistant-web-next/actions/runs/11915097536
(It checks that the coverage results are not empty).
Logs

Closing comment (2025-03-22T14:30:49Z): Since this functionality is enabled by default, there isn't much we can do in v9 to fix this issue without breaking changes. Instead I have added a warning that is logged whenever optimizeTranslationDirective is unset, which recommends disabling the feature (or explicitly enabling it if desired).
The functionality will be disabled and removed in the next major version (tracked in #3435), combined with the warning to disable, I believe should be sufficient to close this issue.
Let me know if anyone disagrees, we can also opt to keep this open until the next major is released 🙏