cant read messages from .js files
See original GitHub issuei make en-Us.js file in lang folder and put this code
export default { "welcome" : "sdfs", account_description: 'Account description', }
but not loaded.
i found problem there
`/**
- Asynchronously load messages from translation files
- @param {VueI18n} i18n vue-i18n instance
- @param {String} lang Language code to load
- @return {Promise} / export function loadLanguageAsync (i18n, lang) { if (!i18n.loadedLanguages) { i18n.loadedLanguages = [] } if (!i18n.loadedLanguages.includes(lang)) { const langOptions = i18n.locales.find(l => l.code === lang) if (langOptions) { const { langFile } = langOptions; return import(/ webpackChunkName: “lang-[request]” */ ‘~/<%= options.langDir %>’+langFile) .then(msgs => { i18n.setLocaleMessage(lang, msgs) i18n.loadedLanguages.push(lang) return }) } } return Promise.resolve() }`
in line
i18n.setLocaleMessage(lang, msgs)
to
i18n.setLocaleMessage(lang, msgs.default)
its true?
<div align="right">This question is available on Nuxt.js community (#c34)</div>Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
cant read messages from .js files · Issue #54 · nuxt-modules/i18n
i make en-Us.js file in lang folder and put this code export default { "welcome" : "sdfs", ... cant read messages from .js...
Read more >'Cannot GET /messages/' in node.js - Stack Overflow
Try to change the the order. First declare the /message route, and after that declare the static files. You want to first use...
Read more >What went wrong? Troubleshooting JavaScript - MDN Web Docs
Go to the tab that you've got number-game-errors.html open in, and open your JavaScript console. You should see an error message along the ......
Read more >(DISCORD BOT) typeerror: cannot read properties of ...
Node.js. Hey all, I'm coding a discord bot and I've coded a ... Cannot read properties of undefined (reading 'messages') at file:///C:/Users ...
Read more >Chapter 1, Writing Your First JavaScript Program - O'Reilly
When adding the src attribute to link to an external JavaScript file, don't add any JavaScript code between the opening and closing <script>...
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
@amazzoccone Location files can be js files as well! They need the correct export though (Example)
This should be fixed in current version as it takes into account possible
export.default
property: https://github.com/nuxt-community/nuxt-i18n/blob/a6172ec0b2387c24424d50189fee015e20232a95/src/templates/utils.js#L23-L25