opral / inlang-paraglide-js

Tree-shakable i18n library build on the inlang ecosystem.
https://inlang.com/m/gerre34r/library-inlang-paraglideJs
38 stars 0 forks source link

[Next.js] App router `generateStaticParams` support? #197

Open r0skar opened 3 weeks ago

r0skar commented 3 weeks ago

Hi! I am not a 100% sure, but I guess this is related to #109. Is there a way/plan on how to use generateStaticParams [ref] to pre-render pages for all languages? I reckon its not possible, because generateStaticParams can only return paths matching the route, but the language prefx/path would need to come first.

Some pseudo code:

// app/p/[slug]/page.tsx
export async function generateStaticParams() {
 // This would return `/p/de/test`, but we need `/de/p/test`
  slugs.map((slug) => ({
    availableLanguageTags.map((language) => ({
      slug: `/${language}/${slug}`,
    }))
  }))
}

Is this ever gonna be possible without a top level [locale] folder?

samuelstroschein commented 2 weeks ago

Hi @r0sker, I am taking over paraglide js from loris this week.

Number one prio is a prerelease of paraglide js 2.0 with variants (pluralization, gendering, etc). Hence, for now i'd say it's not on foreseeable roadmap to support static export in nextjs