Skip to content
Discussion options

You must be logged in to vote

This is something that is not related to typesafe-i18n itself.

In your example you would need to tell SvelteKit how to handle those links.

  1. You could create your own <A> component that accepts an "href" and prepends it with the correct locale.
  2. Store the locale information in a session cookie and read the information from there instead reading it from the url.
  3. You could write a global script that replaces all "hrefs" in the current view and adds the locale (could be a bit hacky).
  4. Create a global redirect in your hooks file and redirect to the language specific url if no locale information is present (not recommended).
  5. Or some other option.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bitdom8
Comment options

Answer selected by ivanhofer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants