Get lang from url param #47
-
Hi, I haven't found any info on handling localization through url params. E.g.: mydomain.com/?lang=de What would be a good practice to realize this with SSR? Is this what locale.get() is for? Or would you want to set the defaultLocale to something like searchParams.get('lang')? Thanks and cheers |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
hi.) i would use the same mechanism as described here, but you would need to implement (probably) cookie storage for
|
Beta Was this translation helpful? Give feedback.
-
Here is an example for current version: https://github.com/sveltekit-i18n/lib/blob/master/examples/locale-param |
Beta Was this translation helpful? Give feedback.
Here is an example for current version: https://github.com/sveltekit-i18n/lib/blob/master/examples/locale-param
You can preview it here