What exactly the end of "Legacy API" means? #2246
Replies: 1 comment
|
Your assumptions are mostly correct, but there's one important caveat worth knowing about. The global So your point 2 is where things get tricky: if any of your components rely on component-scoped translations, you will need to add I ran into this exact situation and created a Vite plugin to solve it automatically: vite-plugin-vue-i18n-sfc-auto-import. The README explains the problem in detail and how the plugin handles it transparently at build time, so you don't have to touch your components at all. Hope this helps! |
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am trying to understand the impact of the deprecation/future removal of Legacy API on my application, from here: https://vue-i18n.intlify.dev/guide/migration/breaking11.html#deprecate-legacy-api-mode
Overall, I do a quite simple use of Vue i18n, I would say ~80%+ of my code simply uses
$t('key'), upgrading to v9/v10/v11 as we went to Vue 3 was not a major issue.Back to the legacy API,
My understanding is that it will work fine in applications using Vue Options API, just how we interact with Vue i18n will change. is that correct?
Going further, I could not understand if this will simply means some overloads will work differently (like the changes in v10), or if there will be a whole set of functions that will no longer work, or that I will need to update all my components somehow...
A few other things I am assuming:
$tand etcsetupfunction to my components callinguseI18n(unless I need to customize something)legacy: falseon mycreateI18n, I would see the issues if I was still relying on the legacy api.If I can use my application with
legacy: falsejust fine, can I expect that the removal of the legacy api will have minor/no effect on it?Thanks in advance
All reactions