Implicit fallback locale rules and lazy loading
See original GitHub issueIf you are in universal mode, and lazy loading locales, you can have problems with fallback locale. I was wondering how to deal with it? Should I merge manually the locale files for the fallback languages or should it be handled by the plugin?
For exemple: en.json
{
title: "My title",
description: "Lorem Ipsum"
}
en-US.json
{
title: "My awesome title"
}
I want to modify only some words in a fallback language and use the base language for the rest. The vue-i18n
merge strategy is perfect for that. But, since I lazy load locales, I have something like this:
lang/
lazy/
en.js
en-US.js
translations/
en.json
en-US.json
en.js
import en from '../translation/en.json'
export default en
en-US.js
import enUS from '../translation/en-US.json'
export default enUS
So if I navigate through the en version, en.json is loaded and then I switch, en-US.json is loaded and everything works as expected. Problem is when I refresh the en-US version. What is the strategy to adopt here?
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:10
Top Results From Across the Web
Unable to find a way to lazy load messages per component ...
Hi,. Currently my messages are stored in JSON files in src/locales folder. I have one JSON for each component/language (e.g. MyLocalizedComponent.vue ...
Read more >Domain model purity and lazy loading
Lazy loading is a design pattern where you defer initialization of an object until the time when it's needed. The purpose of this...
Read more >Disable Lazy Loading in Entity Framework Core - Stack Overflow
There seems to be some confusion about what lazy loading off means. When the lazy loading is off, then EF Core won't load...
Read more >Rails Internationalization (I18n) API - Ruby on Rails Guides
The backend lazy-loads these translations when a translation is looked up for the first time. This backend can be swapped with something else...
Read more >Lazy Loading - Spartacus Documentation - SAP
Lazy loading, also known as code splitting, lets you divide your JavaScript code into multiple chunks. The result is that you do not...
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 Free
Top 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
It works if you define a fallback.
https://codesandbox.io/s/suspicious-leavitt-62b68?file=/nuxt.config.js
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.