Any Idea how would a Language Switcher Component be built using this? #32
Replies: 1 comment 1 reply
-
astroI18n.langCodes
.filter(langCode => langCode !== astroI18n.langCode) // optional (excludes current language)
.map(langCode => l(Astro.url.pathname, {}, langCode)) // translate the url for every langCode I didn't include a language switcher because the html structure may vary depending on your styles, but this is the idea. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm new to internationalization and I'm trying to build a language switcher with this library any idea of how it may be done?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions