jlarmstrongiv / astro-i18n-aut

The i18n integration for Astro 🧑‍🚀
https://www.npmjs.com/package/astro-i18n-aut
MIT License
125 stars 12 forks source link

Link to current locale? #53

Closed artt closed 3 months ago

artt commented 3 months ago

Is there a built-in way to have links in the page link to the current locale? For example, if I'm in /es/about then I want link to Home from that page to go to /es and not to /.

I imagine I could create a custom Link component to take care of this. Just don't want to reinvent the wheel. Thanks!

jlarmstrongiv commented 3 months ago

They aren’t documented yet, but there are several helpers included. For example, you can use getLocaleUrl("/", getLocale(Astro.url)) to go to /es. Thanks for asking!