opral / inlang-paraglide-js

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

BUG: resolveRoute inconsistence with $page.url.pathname in SvelteKit #251

Open TheRealSeber opened 4 weeks ago

TheRealSeber commented 4 weeks ago

Assume that we are having en as base language and pl as the second one.

At http://localhost:5173/ console.log(i18n.resolveRoute('/'), $page.url.pathname) results in: / /

At http://localhost:5173/pl console.log(i18n.resolveRoute('/'), $page.url.pathname) results in: /pl/ /pl

It raises logical issues in comparing those two in if statements. A workaround seems to be: i18n.resolveRoute('/').startsWith($page.url.pathname), however I find it annoying

Also for whatever reason e.g. at At http://localhost:5173/pl/about console.log(i18n.resolveRoute('/about'), $page.url.pathname) results in: /pl/about /pl/about - which is correct

samuelstroschein commented 3 weeks ago

Thanks for opening the issue. If you fix the bug, can you open a PR?

I am hands down on lix 1.0 which is blocking a 2.0 release of Paraglide JS. Read more here