[vue-i18n] Layout messages doesn't update when locale is switched
See original GitHub issueVersions:
@inertiajs/inertia
version: 0.9.2@inertiajs/inertia-vue
version: 0.6.2vue-i18n
version: 8.26.7
Describe the problem:
When I use layout: {Layout}
, translation messages are not updated in layout file, but when I use components: {Layout}
and manually wrap with <layout></layout>
in every single page, messages are updated.
Steps to reproduce:
- Use layout as
layout: {Layout}
(or even make it global inresolve
, it doesn’t matter) - Install
vue-i18n
package - Configure it according to the official docs
- Copy-paste locale switching example from official docs
Only page’s (<slot/>
) messages will be updated.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Data not updating properly on i18n lang switch
$i18n.messages with the translations, then switch the locale of $i18n and only then change the slug in the route (i.e. navigate to the...
Read more >Locale changing | Vue I18n
⚠️ Changing $i18n. locale inside a component does not update the root locale. If you rely on the root locale, for example when...
Read more >Formatting is broken when switching language · Issue #983
When I use translation strings in a template and I switch locale, I expect the strings to be formatted in the chosen locale....
Read more >The Ultimate Vue Localization Guide
Dive into Vue localization and learn how to plug the Vue I18n library into your app, so you can make it accessible to...
Read more >Vue i18n: Building a multi-language app with locale switcher
Switching the locale. Integrating Vue Router and making it work with multiple locales. Lazy load translation files based on the chosen locale.
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
In that case, I recommend you to ask your question in our Discord, as a GitHub Discussions topic, or perhaps even over at the Laracasts forums, as those places are more suitable compared to the issue tracker, as well as that there’s many others (especially on our Discord) that might be able to help with this 👍
I have tried
this.$forceUpdate()
before opening this issue, but it didn’t help. Anyway, thanks! 😃