At which point of the nuxt lifecycle is i18n ready?
See original GitHub issueI want to use this.$i18n
in a computed property in one of my components, e.g.
topLevelDomain() {
return getTldForLocale(this.$i18n.localeProperties)
}
However, it seems that $i18n is not initialized (correctly) at this point of time, because
console.log(this.$i18n.locale)
logs { code: ""}
This only happens in production mode (nuxt build, nuxt start), and not in dev mode (nuxt).
Is there anything to consider in production mode?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Nuxt Lifecycle
The Nuxt lifecycle describes what happens after the build phase, where your application is bundled, chunked and minified. What happens after this phase ......
Read more >A Guide to Localizing with Nuxt.js | Phrase
In this tutorial, we'll use a library called nuxt-i18n , based on vue-i18n , with some Nuxt-specific localization options. Before installing the ...
Read more >Nuxt 3 Stable Launch – All the details from Nuxt Nation 2022
Nuxt 3 started its beta phase last October and after 400 days, 29000 commits on Github, and 320 contributors a stable version of...
Read more >Multi-Language Blog with Nuxt content module.
To do a multi-language blog the first thing you need is to add i18n (Internationalization) module to your app. Of course. Nuxt already...
Read more >Why Nuxt.js is the perfect framework for building static websites
So why are we using Nuxt for this project? Let's take a close look at layouts, pages and lifecycle hooks. Layouts. Layout is...
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
It’s already initialized when your component’s or page’s code runs. So there must be something else in your project that causes this issue.
That would indicate some bigger issue at play, I’d think.