Reload of JSON language files
See original GitHub issueI store translations in JSON files and configure nuxt-i18n like this:
['nuxt-i18n', {
locales: [locale.language],
vueI18n: {
messages: {
[locale.code]: require('./locales/' + locale.code + '.json')
}
},
defaultLocale: locale.code
}]
My use case is that I use nuxt generate to generate separate sites for all languages that are served from different domains, so I only specify one language per build.
The problem I’m facing is that changes to ./locales/.json
are only visible in the app after I restart the dev server.
Having
watch: [
'~/locales'
],
in nuxt.config.js does cause the page to reload when I save locales files, but the changes are not visible.
Any thoughs on this?
<div align="right">This question is available on Nuxt.js community (#c28)</div>Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Reload of JSON language files · Issue #36 · nuxt-modules/i18n
I store translations in JSON files and configure nuxt-i18n like this: ['nuxt-i18n', { locales: [locale.language], vueI18n: { messages: ...
Read more >How to refresh a page whenever my json data file changes
Create a timer, fetch the json file every X milliseconds. If the json contents has changed since the last fetch, reload the page....
Read more >How to translate JSON files: guide to l10n & i18n with examples
In this article you'll learn about JSON localization, internationalization, working with JSON, and how to translate JSON files.
Read more >json file doesn't seem to reload - GameMaker Community
I'm using this locale system I found on youtube to change languages in my game. Until recently it's been working flawlessly - but...
Read more >Paste JSON as Code (Refresh) - Visual Studio Marketplace
Extension for Visual Studio Code - Copy JSON, paste as Go, TypeScript, C#, C++ and more.
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
using lazy-load-translations to reload the translations.
I’m currently using nodemon for this purpouse. Of course a full restart of the dev server is still needed to reload the translations.
package.json