-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
languages from useI18next() contains only 1 language #141
Comments
same issue here , and I found it can get two in pages/index , but can only get one in component/Header/index |
I think it's because of my gatsby-browser.tsx. so I can not access the whole languages. |
I think I found some solution, maybe could work. I change mine to :
and this work foe me. |
Hey @Dennnnny It does work indeed! would you mind sharing the source where you found an example of this solution? I can't quite figure out why it's working. Thank you! |
@gabric098 here's what I found : https://andremonteiro.pt/gatsby-i18next-wrap-page-element/ |
Thank you @Dennnnny, really appreciated |
I'm running
gatsby 4.12.1
withreact 18.2.0
using latest version ofgatsby-plugin-react-i18next
.I followed the examples included in the plugin. When I try to obtain the list of available languages using the following code:
I keep getting only
['en']
in thelanguages
array even if there's no en language defined in my setup.Here's how my
gatsby-config.js
looks like:I've created the following files:
locales/de/translation.json
locales/es/translation.json
All seems to be working fine, If I access
http://localhost:8000/
I get the German translations, If I accesshttp://localhost:8000/es
I get the Spanish. However, when I try to list the available languages by using the following code:no matter what,
languages
always contains a single elementen
.Does anyone have any idea about what I'm doing wrong?
The text was updated successfully, but these errors were encountered: