I am having a problem with my Nuxt.js app.
I have installed nuxt-i18n 5.8.0, and made the following configuration in my nuxt.config.js file
[
'nuxt-i18n',
{
locales: [
{
name: 'English',
code: 'en',
iso: 'en-US',
file: 'en-US.js'
},
{
name: 'Greek',
code: 'el',
iso: 'el-GR',
file: 'el-GR.js'
}
],
lazy: true,
langDir: 'lang/',
defaultLocale: process.env.DEFAULT_LANG || 'en',
baseUrl: process.env.BASE_URL,
seo: false
}
]
When I am in the default language, and clicking on a link in the page, the result is a ‘Page not found’ error. If I refresh the page, it works.
This happens in every page for every link with the default language.
If I use the secondary language, navigation works fine.
Any help??
Thnx!!
3
Answers
i was has same issue to fix it add disable the detect browser language in :
Please set fallbackLocale like below:
Please read link below for more information:
https://github.com/nuxt-community/i18n-module
add this line to i18n in your nuxt.config.js
strategy: ‘prefix_and_default’