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/plconsole.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/aboutconsole.log(i18n.resolveRoute('/about'), $page.url.pathname) results in: /pl/about /pl/about - which is correct
Assume that we are having
en
as base language andpl
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 annoyingAlso 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