You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
folder react is with the Counter react component added on the pages.
i18next is in this case set to detect language with query string and or path (and both work when there's a react component ready and hydrated). Also i18next logs to browser console.
folder without-react-component is the same as react but just without the Counter component on the pages.
i18next is in this case is set the same way, but now there is no console output
In both cases strings which are on the Astro pages are translated server side when the server is run or the project is built, which means they are not dynamic in any way for ex. that the URL query (?lng=XX) does not change them (and that is fine).
Basically what happens is that i18next does not get loaded client side, when there's no UI framework present and hydrated on a page. I guess that this makes sense, because i18n runs with injectScript: before-hydration, and when there is nothing to hydrate, then, i18n just doesn't load.
Although this makes sense to me, I would like to have this confirmed, and maybe added to the documentation.
Thanks a lot!
The text was updated successfully, but these errors were encountered:
Hi!
This is a follow up to: #37 (comment)
Basic example of this is created here: https://github.com/dallyh/astro-i18n-client-server-example-react which is basically the astro-i18next React example slightly modified.
In both cases strings which are on the Astro pages are translated server side when the server is run or the project is built, which means they are not dynamic in any way for ex. that the URL query (?lng=XX) does not change them (and that is fine).
Basically what happens is that i18next does not get loaded client side, when there's no UI framework present and hydrated on a page. I guess that this makes sense, because i18n runs with
injectScript: before-hydration
, and when there is nothing to hydrate, then, i18n just doesn't load.Although this makes sense to me, I would like to have this confirmed, and maybe added to the documentation.
Thanks a lot!
The text was updated successfully, but these errors were encountered: