So I have been getting into astro-i18next for localizing my Astro project.
Though I ran into some issues when trying to use the localization functionality in React (tsx) components.
I am not sure if everything what I am trying to do is even supposed to work, but I’d really like the i18n to work in my react components, which are nested within astro components, as well.
Especially for things like localizePath().
I have correctly set up react-i18next as a plugin for astro-i18next and the init and the useTranslation() hook with the t() function work correctly.
Though both the LanguageSelector (as it’s an Astro component, which thus cannot be nested within a framework / react component), as well as the localizePath() function don’t seem to work in any react environment.
So, I am not really sure how to link to any internal pages / routes in my react components.
Either I’d have to drop React or astro-i18next, which really is a pity.
So any help or suggestions for workarounds on this matter are welcomed with open arms 🙂
