-
Hi, I am building a website using Nuxt v3.10.3 with Strapi as a headless CMS. I have multiple locales and page names can be different per locale (also not all pages may be available in every locale). I added @nuxtjs/i18n in version 8.1.1 to my project and added some basic configuration to my nuxt.config.ts file:
In my dynamic page template [...slug].vue I set it up to fetch the locale from
this works fine if I use However, the goal is to pre-render the whole page and only deploy the static HTML pages. Since i am dealing with dynamic routes, I am fetching them and adding them to the nitro router:
I can see all of the pages in the slug list when I use Does anyone have any input of how this would need to be done? Or will I need to overwrite the locale again in my page before fetching the data? Thanks Update: I assumed the defaultLocale was being used but I changed that to 'cs' just now but it is still the 'de-DE' pages it can find, not the rest. All of this is happening in docker containers |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Found an answer - or at least one on the way. The locale config seems to be the cause of the problem. I updated it to a simple list and that worked:
|
Beta Was this translation helpful? Give feedback.
-
Can confirm that it is the domains part that makes this not work for me. One sentence in the documentation caught my eye with the info now in mind:
With it hard-coded to no it works, with it set to |
Beta Was this translation helpful? Give feedback.
-
I ended up doing separate docker containers per domain to be generated and setting the locales for each via environmental variables so that i can re-use the docker image but generate the different versions and also limit the dynamic routes to those for each domain by iterating over the locales I actively need.
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue but using different docker-images is no solution for me, since I am using GitHub pages for deploying my static pages. I also used a My issue: When running Just have a look here: nuxt.config.ts hook
generated output
As you can see,
and the correct route:
I am using the default nitro crawlLinks configuration and also using the i18n config What am I missing? I tried out a couple of things:
Any idea? I know that this discussion is officially resolve but my issue still persists while I can't use different docker-images. |
Beta Was this translation helpful? Give feedback.
I ended up doing separate docker containers per domain to be generated and setting the locales for each via environmental variables so that i can re-use the docker image but generate the different versions and also limit the dynamic routes to those for each domain by iterating over the locales I actively need.