vue-i18n icon indicating copy to clipboard operation
vue-i18n copied to clipboard

"$te" missing in componsition global scope (implicit-way)

Open namespace-github opened this issue 1 year ago • 1 comments

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

namespace-github avatar Aug 04 '22 14:08 namespace-github

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.

hendrik-schneider avatar Aug 05 '22 09:08 hendrik-schneider

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.

Maximus1000 avatar Oct 30 '22 21:10 Maximus1000

I've fixed in vue-i18n v9.3.0-beta.7

kazupon avatar Nov 15 '22 17:11 kazupon