i18n
i18n copied to clipboard
Wrong locale set in asyncData context
setup
- I am working on a static page with multiple languages
- I have one dynamic entrypoint (
pages/_.vue) - The page generation is based on the result of an api call that happens inside of asyncData
- The CMS needs the correct language code + the url/slug to retrieve the correct page
the issue
When I execute npm run generate all routes get generated correctly, except for the base route of the none default language.
In my example that would be /hr for the croation language.
The context has the following values set:
{
url: '/hr',
i18n: {
code: 'en',
iso: 'en-US',
name: 'English'
},
route: {
name: 'all___en',
meta: [
{}
],
path: '/hr',
hash: '',
query: {},
params: {
pathMatch: 'hr'
},
fullPath: '/hr',
matched: [
[Object]
]
}
}
If more infos are needed, feel free to ask :)