Lazy Load json files after generating static files
See original GitHub issueHello!
I was trying around a bit if I can use this plugin for my next project. It is awsome by the way. Could set up routing and translation in about 40 minutes! yay!
But I found one issue. When using “npm run generate” to generate static files - the first page load does not show the translations! If I change the language it starts working. It seems that on inital load the json language file is not working. Does anybody have any clue how i can solve that?
I made a git repo here https://github.com/elpeyotl/nuxt-translation. attached a screenshot of the behaviour.
Well it is only not working when generating static pages. In npn run dev it is working.
my config
module.exports = { modules: [ ['nuxt-i18n', { locales: [ { code: 'en', iso: 'en-US', name: 'English', langFile: 'en-US.json' }, { code: 'fr', iso: 'fr-FR', name: 'Français', langFile: 'fr-FR.json' }, { code: 'de', iso: 'de-DE', name: 'Deutsch', langFile: 'de-DE.json' } ], loadLanguagesAsync: true, langDir: 'lang/', defaultLocale: 'en', // ... }] ] }
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (2 by maintainers)
Top GitHub Comments
Looks like the bug is fixed. Thank you, Paul! But there is another (rare) edge case. Will open up a new issue for it in a second
Hi guys, sorry for this frustrating issue. Hopefully it’s fixed in v2.3.4. @elpeyotl thanks for the repo, I tested it with the new version and it looks okay!