i18n block not working in Vue 3 with options API
See original GitHub issueReporting a bug?
The i18n custom block in SFC doesn’t work in Vue 3 when using the “older” options API.
The global translations are working, but the local translations aren’t.
Expected behavior
I expect my local translations to work when using the block
Reproduction
https://stackblitz.com/edit/vitejs-vite-qoza92?file=src/App.vue
System Info
System:
OS: Linux 5.0 undefined
CPU: (4) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.17.0 - /usr/local/bin/npm
npmPackages:
@intlify/vite-plugin-vue-i18n: ^6.0.3 => 6.0.3
@vitejs/plugin-vue: ^3.1.0 => 3.1.0
@vue/compiler-sfc: ^3.2.39 => 3.2.39
vite: ^3.1.3 => 3.1.3
vue: ^3.2.39 => 3.2.39
vue-i18n: ^9.2.2 => 9.2.2
vue-tsc: ^0.40.13 => 0.40.13
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Breaking Changes - Vue I18n
Reason: Vue 3 Global API changes, and Vue 3 API architecture changes related for component instances. Rename to datetimeFormats from ...
Read more >Issues · intlify/vue-i18n-next - GitHub
Contribute to intlify/vue-i18n-next development by creating an account on ... i18n block not working in Vue 3 with options API ❗ p4-important Priority...
Read more >How to Load i18n Locales Asynchronously in Vue 3 + Vite
Learn how to load Vue I18n locales lazily in your multi-language Vue 3 + Vite application to decrease initial bundle size- with source...
Read more >i18n custom block on Vue3 + Vite - Stack Overflow
I have a Laravel + Inertja + Vue 3 project using Vite. I installed i18n plugin to be able to manage UI translation....
Read more >The Ultimate Vue Localization Guide | Phrase
Note » You'll want v9+ of Vue I18n if you're working with Vue 3. ... All config options for createI18n() are available in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can confirm that @Adnan-kreiker 's workaround works, except for translations with substrings (something like
Foo {bar}
). To get them to work I made the hack a bit hackier:Sorry, I’m currently busy with another developments. Please wait. 🙏