Closed FarhadG closed 3 years ago
Working on a solution to this (and other static site permutations) with @iliapir — we are experimenting with:
<Experiment>
/<Variant>
pairs; in OP's case maybe a <LanguageProvider>
)
pages/faqs
might have language permutations en
& es
getStaticPaths
, + using getStaticProps
to compute which permutation to show
pages/faqs
might emit pages/faqs_-_en
& pages/faqs_-_es
@FarhadG does this sound like an approach that will solve your statically-compiled internationalization needs? @timneutkens does this look like the right approach within Next.js?
Early feedback is much appreciated, as we suspect this will require monkeying in next/build/utils.ts#isPageStatic
(e.g. by wrapping mod.getStaticPaths
). If our spike works out, we expect to have a PR ready for comments in a week or three.
@BiscuiTech @AlexOros — a week or three was a little ambitious. But the PR is up and good to go! #14454
Note that the CI error is due to the addition of a path
parameter passed to getStaticProps({ params: { path } })
for files w/o a dynamic segment.
Please see the following RFC for first-class i18n support in Next.js: https://github.com/vercel/next.js/discussions/17078
Thanks!
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Feature request
Internationalization capabilities with a full static site (i.e. serverless)
Is your feature request related to a problem? Please describe.
Inability to compile a static site with all language ahead of time.
A clear and concise description of what you want and what your use case is.
Describe the solution you'd like
The ability to provide a static site with multiple languages pre-compiled.