opral / inlang-paraglide-js

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

NextJS Adapter simplify Setup #76

Closed LorisSigrist closed 2 months ago

LorisSigrist commented 2 months ago

Context

The NextJS Adapter setup is quite involved ATM.

  1. Install the Package + Paraglide (still needs
  2. Add it to next.config.js
  3. Create the src/lib/i18n.ts file & initialize paraglide\~
  4. Add the middleware
  5. Add the LanguageProvider
  6. Use the translated routing APIs

Steps 1-4 could easily be automated / provided in a template.

Step 5 Is only necessary to call setLanguageTag on the server. If we can figure out how to solve PARJS-31 this may become obsolete

Step 6 Is likely here to stay

Proposal