vue-i18n
vue-i18n copied to clipboard
"$te" missing in componsition global scope (implicit-way)
Reporting a bug?
Using $te in vue-components are not available with vue-i18n 9.2.0. The others like $t, $tm however exists: https://vue-i18n.intlify.dev/guide/advanced/composition.html#global-scope (implicit)
Expected behavior
In Vue-Templates access to "$te"
Reproduction
Add in a vue-template: {{ $te('foo.bar') ? 'exists' : 'missing' }}
System Info
vue-i18n 9.2.0
vue 3.2.37
Screenshot
No response
Additional context
Would be so nice to add it, so i can disable the legacy-mode.
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 Discussion
- [X] The provided reproduction is a minimal reproducible example of the bug.
Same here. It would fully fit into the idea and concept of the implicit global scope.
We would get to benefit from the composition api and say goodbye to legacy.
Anyone have a strategy when using composition api for a fallback when $t(somekey.i18n) doesn't exist in dictionary?
I can't seem to find an answer to this, like how to fail to a string message like this (going back to legacy not an option):
{{ $t(warning?.i18n) ?? warning?.message })
// simply returns the non-translated string key as opposed to falling to message.
I've fixed in vue-i18n v9.3.0-beta.7