intlify / vue-i18n

Vue I18n for Vue 3

Home Page:https://vue-i18n.intlify.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to use with option api when legacy is false

magic3584 opened this issue · comments

Reporting a bug?

const i18n = createI18n({
locale: "en", // set locale
fallbackLocale: "en", // set fallback locale
messages, // set locale messages
legacy: false,
});

It works fine in template, but I cannot how to use in option api like in methods.
I have tried this.$i18n.t this.$i18n.$t $t,does not work

Expected behavior

use like in template $t('message.key')

Reproduction

no

System Info

vue-i18n: 9 => 9.8.0

Screenshot

No response

Additional context

No response

Validations