Closed coddo closed 3 years ago
Having the same problem in Quasar with vue-i18n-next
legacy: false,
If you specify lategy: false
options in createI18n
, tc
is no longer supported in composition API mode, since it has been merged into t
.
See the API docs: https://vue-i18n.intlify.dev/api/composition.html
Thanks!
Module versions
vue-cli-plugin-i18n
: 2.1.1To Reproduce
This error is encountered when upgrading the plugin from v1.x to v2.x. In my case, I went from v1.0.1 to v2.1.1.
I am using Vue 3 with composition API and single-file components.
Steps to reproduce the behavior:
test_message
and valueApple | Apples
<p>{{ $tc('test_message', 1) }}</p>
and<p>{{ $tc('test_message', 2) }}</p>
vue-cli-plugin-i18n
to the latest version (v2.1.1)createI18n({})
, the following options are now also needed:globalInjection: true
andlegacy: false
TypeError: _ctx.$tc is not a function
Expected behavior
Everything should work normally as with the previous version and I should see the difference in pluralization on the 2 elements.
I get the same issue when trying to call the tc function in Typescript:
Additional context
To be noted that the
$t()
function still works normally, just the$tc()
one gets broken. I haven't tested other functions.