You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently for the SvelteKit adapter we have no option to use domain-based strategy as is possible for Next see docs. Are there any plans to implement this for SvelteKit too or is there any workaround/way to do it right now?
The text was updated successfully, but these errors were encountered:
No plans at the moment to support domain based routing in SvelteKit.
You can create your own domain based routing already with plain Paraglide JS. Out of my head (likely needs tweaking!):
Have an AsyncLocalStorage in a server handle hook.
Set the language to a getter of the async local storage setLanguageTag(() => asyncStorage.getStore())
Detect the language of the user based on the domain in a server handle hook.
Wrap the return value of the handle hook with asyncStorage.run()
Call setLanguageTag() on the client (best in the root component, most often the layout) with the detected language
Plans exist with Paraglide JS 2.0 to have a guide for this, and generally recommend people to use their own routing solution. The opinionated structure of the current SvelteKit adapter is unmaintainable. People have all sorts of edge cases. It's better to have a good abstraction (as Paraglide JS already is!) and guide developers to write a bit of code themselves that they control.
Currently for the SvelteKit adapter we have no option to use domain-based strategy as is possible for Next see docs. Are there any plans to implement this for SvelteKit too or is there any workaround/way to do it right now?
The text was updated successfully, but these errors were encountered: