ivanhofer/typesafe-i18n-demo-sveltekit

How to deal with Routing?

Closed this issue · 3 comments

i cant figure out how to deal with routing with this system.

<a href={'/${locale}/about'}>About</a>
(backticks changed with quotes for code markdown in github)

If im linking the paths like this and change from english to german language and click on the about link im getting the about page in english again. But if i refresh the wohle page after the language change it will stay german all the time. Is there a solution without refreshing?

Not entirely shure how you implemented it but it works in this repo.
You can take a look at the LocaleSwitcher.svelte component.

I just reallised i posted in the wrong repo. I use the JavaScript Version of your Project.. Sorry :D

I created a new project and merged my existing one with your i18n files. So i implemented it more or less 1:1

I really struggle to understand whats happening there to be honest. I uploaded my repo.. Would you be so kind and could check if you find something or explain to me exactly how I do that?

https://github.com/MrNamazu/xivdbi18ntest

LocaleSwitcher is renamed in src\lib\components\layout\langswitch.svelte
Navigation is src\lib\components\layout\nav.svelte

I have created a PR in your repo.
I'll close this issue since it is no typesafe-i18n bug.
We can continue the discussion in your repo if you still have questions :)