Support per-component translations using experimental.autoImportTranslationFunctions
#2900
Open
3 of 4 tasks
Labels
Describe the feature
Auto-import of
$t
is a great feature, but it clutters the console with messages in case per-component translations are used (no matter if they are used together with global translations or only them).I know I can turn these messages off, but I'd rather not do that - they might be useful in case of a typo or something.
Currently (with the experimental feature turned off), I split imports like this:
I have some global translations that are used in many components / composables, and I have local translations that only relate to one component, and I'd like to keep those mechanics but take advantage of the auto-import feature without cluttering up the console.
Technically it looks pretty straightforward to import
{ t, d, n, ... }
using local scope together with{ t: $t, d: $d, n: $n }
, but I'm not sure what else this approach might affect.Minimal reproduction: https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-6x9weq?file=pages%2Findex.vue
What do you think?
Additional information
Final checks
The text was updated successfully, but these errors were encountered: