vue-i18n
vue-i18n copied to clipboard
[v9.6.4] Suppressing automatic locale fallback with `!` causes redundant `console.warn`s for missing keys
trafficstars
Reporting a bug?
Thanks for a wonderful library!
{ locale: 'en-US!' } causes the library to console.warn about falling back to en-US for all translation keys, and appears to perform a redundant resolution step for missing keys.
Expected behavior
{ locale: 'en-US!' } should be identical to { locale: 'en-US' }, except with no fallback strategy, and no fallback-related console.warn logs should be present, as detailed in the docs:
To suppress the automatic fallback, add the postfix exclamation mark
!, for examplede-DE!
The final translation output is as expected, but the steps to get there are not.
Reproduction
Open up browser developer tools to view console logs.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.18.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.4.2 - /usr/local/bin/npm
pnpm: 8.9.2 - /usr/local/bin/pnpm
npmPackages:
@vitejs/plugin-vue: ^4.2.3 => 4.3.4
vite: ^4.4.9 => 4.4.9
vue: ^3.3.4 => 3.3.4
vue-i18n: ^9.6.4 => 9.6.4
vue-tsc: ^1.8.8 => 1.8.10
Screenshot
Additional context
No response
Validations
- [X] Read the Contributing Guidelines
- [X] Read the Documentation
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A open a GitHub Discussions