astrolicious / i18n

Yet another i18n integration for Astro with server and client utilities, type safety and translations built-in.
https://astro-i18n.netlify.app/
MIT License
52 stars 3 forks source link

Pathname starting with locale forces locale #38

Open amosbastian opened 3 weeks ago

amosbastian commented 3 weeks ago

So, for example if the path is /freedom and you have the locale fr, then it will switch to French even if your current locale is English for example.

Reproduction here: https://github.com/amosbastian/astro-i18n-example

https://github.com/user-attachments/assets/afb59bac-974e-4e7b-b095-5832cb1fcd16

I confirmed it's caused by the pull request #34

florian-lefebvre commented 3 weeks ago

Maybe we just need the check to be a bit less naive. Maybe it should check if it starts with /fr, but is followed by nothing or a slash