-
-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: v-t
directive SSR
#2946
fix: v-t
directive SSR
#2946
Conversation
src/module.ts
Outdated
*/ | ||
|
||
// Use `legacy` as global injections are prefixed (`$t`) | ||
const transformVT = transformVTDirective({ mode: 'legacy' }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think mode
option should be set from i18n.types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm misunderstanding, but the injected component properties are always prefixed with $
(such as $t()
) right?
When passing mode: 'composition'
to the transform it will (in this case incorrectly) transform the code to use t()
without prefix, which I think won't work 🤔.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!
I've just comment to your PR!
Please check it!
@BobbieGoede I've just released unplugin-vue-i18n v5 beta If you set the |
0425f95
to
0347987
Compare
@kazupon I tried updating to the unplugin-vue-i18n beta but I'm getting the following error when running tests: Error: requires 'vue-i18n' or 'petite-vue-i18n' to be present in the dependency tree. Does updating this require updating other deps to incompatible versions? If so, we may have to merge the PR in its current state (unless this won't work for some configs) and delay the unplugin-vue-i18n update for the next major 🤔 |
Thanks!
Hmm, That looks like a bug in unplugin-vue-i18n. 😅 |
@BobbieGoede please try to it! 🙏 |
@kazupon When running the fixture
For any Could you take a look again? 😅 |
@BobbieGoede When I tried the playground, I reproduced your issue on there.
And I noticed that unplugin-vue-i18n depend on message-compiler of vue-i18n v10. I’m just starting work for nuxt-i18n v9 and would like to support |
🔗 Linked issue
❓ Type of change
📚 Description
Resolves kazupon/kazupon#17
I thought adding the directive transformation would have been more involved than this but it seems to be working 😅
I'll see if I can update https://github.com/intlify/vue-i18n-extensions a bit and perhaps experiment with making something like intlify/vue-i18n#1820 possible, though to be honest, I'm not sure if that feature is the right direction but it would be good learning experience.
📝 Checklist