Closed BobbieGoede closed 8 months ago
Name | Edit | Preview | Latest Commit |
---|---|---|---|
i18n | Edit on Studio โ๏ธ | View Live Preview | 05c513f24f432833e5f058f53bc45ed3819f23d4 |
Great work! I am glad you have improved nuxt i18n dx!
Another implementation way for auto impot is to use AST in the bundler transform, which implements nuxt auto-import, or macros such as unplugin-auto-import, or like Vue 3 defineProps
macro way, so we can generate useI18n
executable code.
This method is advanced and difficult to implement, but by injecting the transformed code into the script setup, we don't have worry about releases.
Another implementation way for auto impot is to use AST in the bundler transform, which implements nuxt auto-import, or macros such as unplugin-auto-import, or like Vue 3 defineProps macro way, so we can generate useI18n executable code.
This method is advanced and difficult to implement, but by injecting the transformed code into the script setup, we don't have worry about releases.
Ah yes! I never considered this approach, I'll close this PR for now and see if I can work out a solution using this method. This will give us more control where this functionality is injected, and I'm interested in learning more about this anyway ๐.
๐ Linked issue
1644
โ Type of change
๐ Description
Resolves #1644
Adds
experimental.autoImportTranslationFunctions
, which when enabled adds$t
,$d
and$n
toglobalThis
.I did add the option to the docs but it's the bare minimum, not sure where and how to describe it in a clearer way ๐ค, I suppose it's not that big of a deal while it's an experimental feature?
๐ Checklist