opral / inlang-paraglide-js

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

Change autogenerated middleware to be more readable #117

Closed LorisSigrist closed 1 month ago

LorisSigrist commented 1 month ago

Context

Currently the middleware generated by paraglide-next init is very compact, however it's not obvious how you would integrate it with other middleware. This increases our documentation effort.

Proposal

Change the generated middleware to

import { middleware as paraglide } from "@/lib/i18n"

export function middleware(request: NextRequest) {
   const response = paraglide(request)
   return response
}

This makes it more obvious how you would chain it with other middlewares