vue-i18n
vue-i18n copied to clipboard
te function returns false although fallback exists
trafficstars
Reporting a bug?
te function returns false for de-AT locale although t function is able to fallback to language de.
Expected behavior
I think it is problematic that the behaviour of t and te is different. I propose: if you provide no locale to te function it should be true if t function resolves to a fallback (eg. de-AT -> de) if you provide a locale it should only return true if the message exists in the given locale ignoring fallbacks
Reproduction
https://stackblitz.com/edit/vitejs-vite-tr2dcd?file=src%2FApp.vue
System Info
System:
OS: macOS 14.2
CPU: (8) arm64 Apple M1 Pro
Memory: 95.63 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
Yarn: 1.22.19 - ~/.nvm/versions/node/v20.9.0/bin/yarn
npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
Browsers:
Chrome: 122.0.6261.112
Edge: 113.0.1774.35
Safari: 17.2
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