nuxt-modules / i18n

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

Regression: Retrieve object nodes #2966

Closed Leander250 closed 1 week ago

Leander250 commented 3 weeks ago

Environment

Reproduction

https://github.com/Leander250/nuxt-i18n-regression

Describe the bug

In v7 it was possible to retrieve a node which was not a leaf. For example I could get the "options" node and i18n would return an object with 4 properties:

bescheidform: {
        options: {
          bezAsc: 'Bezeichnung (Aufsteigend)',
          bezDesc: 'Bezeichnung (Absteigend)',
          matchcodeAsc: 'Matchcode (Aufsteigend)',
          matchcodeDesc: 'Matchcode (Absteigend)'
        }
 }

This causes "[intlify] Not found 'bescheidform.options' key in 'en' locale messages."

in v8 instead.

Additional context

Would be nice if we could restore this functionality :)

Logs

No response

kazupon commented 1 week 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!