nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.71k stars 478 forks source link

how can I support returning objects or arrays from the language file? #2967

Closed simpv closed 3 months ago

simpv commented 3 months ago

Environment

Reproduction

--

Describe the bug

I use a .js file to define multilingual content. When using the $t method, how can I support returning objects or arrays from the language file?

Additional context

No response

Logs

No response

kazupon commented 3 months ago

you need to use $tm / tm and $rt / rt. About how to usage, you can read the docs https://vue-i18n.intlify.dev/guide/migration/breaking.html#translation-api-return-value

thanks!