Closed gHashTag closed 3 years ago
Here it seems to work: https://github.com/i18next/i18next-http-backend/blob/master/example/fallback/app.js
So please provide a full reproducible example.
Your example is on the server, and I'm solving the problem in a React Native mobile app. The example is complete and there is nothing to add.
Sorry, I can't reproduce your issue...
What is the log saying whe setting debug to true?
btw: your url seems not to be broken to me: example with en => https://translation.rightwayhealthcare.com/en.json
Yes, a worker, but if I break it like this
https://transl1ation.rightwayhealthcare.com/en.json
then local translation is not connected
Just tested with that url too: "https://transl1ation.rightwayhealthcare.com/en.json"
it works for me.
Please share at least the debug log.
I can't help you, without more information or a reproducible example.
Is this information enough?
Also, when I change the locale, I do not boot the Spanish language.
the first line in your screenshot shows the translations of en are loaded and the next line shows the language is switched to es
Is there any error before this?
Is it possible you're not waiting for the translations to be loaded? When not using Suspense, you need to wait for the ready flag to be true before rendering: https://react.i18next.com/latest/usetranslation-hook#not-using-suspense https://react.i18next.com/latest/withtranslation-hoc#not-using-suspense
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Disable RN Debugger. Plugin don't work if RN Debugger enabled.
I bumped into this issue today as well, I was banging my head against the wall until I found your comment @NeRo8 (thanks!!!). Disabling RN debugger did the trick, but that's not an acceptable solution. In my case, I'll revert to i18next-xhr-backend
, which works with RN debugger as well. It seems to be a common issue with fetch API and RN debugger (https://github.com/facebook/react-native/issues/24627).
Would it be reasonable to be able to opt-out of fetch API and use the XMLHttpRequest fallback only? @adrai
Would it be reasonable to be able to opt-out of fetch API and use the XMLHttpRequest fallback only? @adrai
If I understood correctly this will never happen in a "productive" environment. It's just a debug/dev issue. Can't this be fixed at the root of the causing issue? react-native debugger?
Yea, this is only an issue during development. I'm not sure we'll see the light for a fix with the debugger in any near future, it seems pretty complicated... Anyway, you're probably right, shouldn't try to "fix" it from this repository.
I noticed the "request" option, does that completely replace fetch with a custom function? If yes, I could utilize that to implement a client that works with react native debugger.
I noticed the "request" option, does that completely replace fetch with a custom function? If yes, I could utilize that to implement a client that works with react native debugger.
Yes
Why, in case of an error in the url, local translations are not loaded?
My settings:
example broken url:
loadPath: 'https://tran1slation.rightwayhealthcare.com/{{lng}}.json',
As I do in this case, the local translation should be connected, but it doesn't.
Where am I going wrong?