Hi! I’m trying to enable i18n in my plasmic app, as explained here https://docs.plasmic.app/learn/localization/. I use the 2nd approach, with variants. Basically it works, except that I cannot change the language. If my default language is, e.g. ‘en’, if I navigate to http://localhost:3000/es, I get a 404 not found error.
I’m using a nextjs app, and trying subpath routing for i18n: https://nextjs.org/docs/advanced-features/i18n-routing#locale-strategies
not sure if this is an issue of plasmic or nextjs, but perhaps some of you here have met this problem before
Are you selecting the correct variant based on the locale provided by the router? https://nextjs.org/docs/advanced-features/i18n-routing#accessing-the-locale-information
And you have a global variant named locale or Locale?
If you ignore Next i18n routing and simply try to render a Plasmic page with a specific locale global variant, does it work?
Yes. If, for example, I configure nextjs so that the default language is spanish, when I visit localhost:3000 it shows me the “es” variant of the page
so the variants seem to be ok, the problem is with routing
ah, make sure from getStaticPaths()
, you’re returning fallback: 'blocking'
if you’re not pre-generating all locale paths
Yes! This was the issue. If I change this settings, it works. Thanks very much.