astro-i18next: Translation doesn't work, it shows a key instead of translated text.
Describe the bug
Translation doesn’t work - e.g. in case of translation title={t("cards.documentation.title")} it shows cards.documentation.title on the web page. I guess the same issue is described in discusion #99, and it might be the case on Windows only.
To Reproduce
Steps to reproduce the behavior:
- Open the folder
astro-i18next\examples\nodein VS Code - Run
nmp install, and thennpm run dev, point tohttp://localhost:3000/ - All translated messages are untranslated
Expected behavior
Translated messages should appear.
Screenshots

Context (please complete the following information):
astro-i18nextversion: 1.0.0-beta.15astroversion: 1.9.1- OS: Windows 11
- Browser: Chrome 109, Edge 109
By adding i18nextServer.debug: true the following is observabled in Terminal window, i.e. notice missing slashes in a path.

Possible fixes
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 15
Adding the following configuration to the
astro-i18next.confighas helped:The code at line 78 works incorrectly at least on Windows:
fileURLToPath(config.publicDir) + "locales/{{lng}}/{{ns}}.json",Still seeing this issue when deploying to Vercel
Adapt the code as you need it, don’t forget variables like
defaultLocaleandlocalesGot rid of the fsBackend plugin and added the resources object, and now everything is working. But I hope it’s a temporary solution and the issue will be fixed in the further releases…
Fixed my deploy on Vercel by adding
includeFilesin my adapter settings: