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

Support "locale paths" for routing #147

Closed LorisSigrist closed 1 week ago

LorisSigrist commented 3 weeks ago

Context

Astro i18n has the concept of "locale paths". Basically a custom prefix for a language.

If you have a multipart language tag like de-CH you may not want it in the URL. ch or swiss would be friendlier prefixes. This can be done with locale paths.

Proposal

Add support for locale paths to the Prefix Strategy in Paraglide-SvelteKit and Paraglide-Next.

PrefixStrategy({
  prefixes: {
     "de-CH": "/ch"
  }
})