opral / inlang-paraglide-js

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

Support "locale paths" for routing #147

Closed LorisSigrist closed 5 months ago

LorisSigrist commented 5 months 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"
  }
})