-
-
Notifications
You must be signed in to change notification settings - Fork 37
-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
vite-plugin-vue-i18n custom block messages aren't loaded #120
Comments
I'm using |
I tried to use custom block with vue3 in legacy mode, and it works,code below But I don't konw how to use i18n like this with vue2, can anyone help me? |
Same problem here. I'm trying to progressively a big project to Vue 3 and trying to at least get vue-i18n to work with SFC blocks and Vite with Vue 2.7 while relying on global $t() function. Global messages coming from files are ok, but SFC blocks are not interpreted. I've tried a lot of variations, including unplugin-vue and the bundle tools. |
Same with Nuxt3 + unplugin-vue-i18n |
Vue's |
Sorry I have not been able to reply for a while now. I have been focused on nuxtjs/i18n for a while now. I recently released a nutxjs/i18n beta version of it and will be looking at an issue soon. Pleases wait🙏 |
Thanks for the hard work. Btw, will |
One year later, I am still experiencing this problem. Any progress? Anyone has found a workaround? |
@kazupon any progress thanks ? |
I also encountered this problem and I solved it with the composable <template>
<h1>{{ t('headline') }}</h1>
</template>
<i18n lang="json5">
{
de: {
headline: 'Überschrift'
},
en: {
headline: 'Headline'
},
}
</i18n>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
|
Reporting a bug?
Hi guys,
I have been using custom blocks in sfc for a while.
I migrated from Vue 2 to 3 and Vue i18n from v8 to 9. I used vue cli and vue i18n loader for the custom block. Since the migration, i now use vue 3 + Vue i18n v9 + vite vite-plugin-vue-i18n.
I want to use the legacy api for i18n to minimize the page migration work. However, $t only picks up the global resources loaded from vite.config and my i18n setting below
The custom block doesnt seem to be loaded into the instance for some reason.
Is it a bug or not supported or I missed something?
Expected behavior
custom block messages should be loaded
Reproduction
see description above
Issue Package
vite-plugin-vue-i18n
System Info
Screenshot
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: