Use this tag for questions related to Nuxt.js Internationalization plugin based on Vue-i18n plugin.
Questions tagged [nuxt-i18n]
149 questions
3
votes
2 answers
How to dynamic dir and locale in HtmlAttr in Nuxt3?
I'm using @nuxtjs/i18n plugin with nuxt 3 and after I install it I wrote my i18n(config) in the nuxt.config.ts
my code:
i18n: {
locales: [
{
code: 'fa',
iso: 'fa-IR',
name: 'Farsi',
file:…

amirreza jolani
- 63
- 4
3
votes
0 answers
Nuxt showing 404 page This page could not be found Back to the home page during a shot moment
I made a website using Nuxt, Tailwind and i18n.
It's perfectly running locally (with nuxt build and nuxt start), but when I deploy it (with the same commands) on the server of a hosting company, every page except the "root" one is showing an error…

pragmethik
- 182
- 1
- 7
3
votes
1 answer
Nuxt SSR app takes too long to load in production
I'm currently building a new version of my company's site and we choose Nuxt to do it. For my coworkers, it is important to keep the ability to manage the content so we are keeping Wordpress as a CMS. Then we generate the JSON with Wordpress's REST…

Patrick
- 31
- 2
3
votes
2 answers
Nuxt: i18n.localePath access in middleware
I've defined a namespaced middleware for Nuxt like so:
export default function({ store, redirect, app }){
if (!store.state.isAuth) {
return redirect(app.i18n.localePath('/auth'))
}
}
where if the user is not authenticated, they're…

SSBakh
- 1,487
- 1
- 14
- 27
3
votes
2 answers
Using i18n-nuxt $t in Vuex store
My problem is kinda specific. I'm using Vuex and Nuxt for this project. For the dependency we use i18n-nuxt but somehow I cannot use $t('some.translation') in the $store while in the components it works just fine. I tried every possible combinations…

Can Tomris
- 31
- 1
- 6
3
votes
2 answers
Nuxt.js - How do I use vue-i18n outside components?
I'm using the plugin vue-i18n for translations in a Nuxt.js-powered SPA. This allows easy access to messages within components, like this:
$t('footer.press')
But how do I get translations outside components? In my specific case, I need them in a…

gru
- 2,319
- 6
- 24
- 39
3
votes
0 answers
nuxt-i18n routing is not working with SSR but working on SPA
I was working on nuxt universal(ssr) app and i wanted to add a translation using nuxt-i18n , i followed the config instruction on the site, translation works fine but the routing is not working at all clicking on a link changes the URL on the…

Pompidou
- 577
- 4
- 18
3
votes
0 answers
Nuxt i18n doesn't translate properly while switch lang
I have a site on nuxtjs, there I use nuxt-i18n with two languages setup, english as a default lang.
If I set second language and refresh a page (f5), an issue occur when I try to switch language back to default. But it looks fine with second…

NashGC
- 659
- 8
- 17
3
votes
2 answers
Nuxt and i18n: Google showing mixed language results
I've made a site using Nuxt.
The site has 2 languages: Italian (default) and English for everyone else.
I installed nuxt-i18n and configured it, and everything seems to work fine (especially when looking at the code with the devtools, html lang,…

sintj
- 804
- 2
- 11
- 23
3
votes
1 answer
Get language from nuxt.js middleware
Is there a way in nuxt.js middleware to know the language used for the request (of the page)?
By taking the example proposed by nuxt.js (https://nuxtjs.org/api/pages-middleware/) and by supposing that for example a page declined in two languages…

Skaÿ
- 326
- 1
- 3
- 15
3
votes
0 answers
How to access the i18n instance in a store/action in nuxt?
I have a typescript Vue.js app using vue-i18n and I want to port it to Nuxt.js. In the Vue.js app, I initialized i18n in a file by calling
// Create VueI18n instance with options
const i18n = new VueI18n({
locale: 'ja', // set locale
messages,…

sceee
- 1,681
- 19
- 34
3
votes
1 answer
How to include a link inside nuxt-i18n text
Im trying to use nuxt-I18n module for localization.
I have installed "nuxt-i18n": "^6.4.1"
Also in my nuxt.config.js i have the fallowing
modules: [
[
'nuxt-i18n',
{
defaultLocale: 'en',
…

mart cube
- 633
- 1
- 15
- 30
3
votes
1 answer
ENOENT: no such file or directory preview.vue, prismic module and nuxt-i18n
I get an error message when I use @nuxtjs/prismic and nuxt-i18n.
Error message :
ERROR ENOENT: no such file or directory, open 'C:\wamp64\www\nuxt-test\prismic\.nuxt\prismic\pages\preview.vue
package.json :
{
"name": "prismic-nuxtjs",
…

alex sas
- 31
- 1
- 2
3
votes
0 answers
How always redirect to browser language page in nuxtjs?
I use nuxt and nuxt-i18n for my multilingual site. By default, if user open my site, they redirected to their language page. After this he can change locale. But if user close browser tab and open it again, he not be redirected. I set in config:
…

tolyan
- 809
- 3
- 10
- 27
3
votes
0 answers
How to use translations from vuex store or function for custom paths with nuxt-i18n
I'm working on the internalization of my website and the nuxt-i18n module has served me well so far. However, I haven't figured out how to fetch and load translations for the path from a server.
In case of the common translations, I fetch…

Dan
- 473
- 3
- 13