-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Interpolation not working in ICU format when fetching an endpoint #52
Comments
This should work without problems. There should be no influence based on the origin of the translation resources. |
@adrai Thanks for the reply! No, there is no warning, unfortunately. |
Sorry, but I need to see the http response, if it is a correct json. I suspect there is an issue in the http response body. |
I cannot provide you the real endpoint, but I replicate it as real as I could and you can find it in that codesandbox. |
Just saw, you're not using suspense. |
Another thing you could check is, the used language code format: https://www.i18next.com/how-to/faq#how-should-the-language-codes-be-formatted Try en-US instead of en_US |
I've just used Suspense but it's not working. If there was a problem with a "ready state", nothing would have loaded, not even the "Delete" part. |
Did you try to use en-US and not en-US? |
Yes, as I said before: with the other format, it works 👍🏼 I was just curious about the explanation, but you gave to me with the intl message format constructor. Thanks again! We can close this pr |
I also have this problem. Using the language codes "en", "de" and "nl". As soon as I remove the .use(ICU) line, interpolation is working again. There seems to be some problem with interpolation and ICU. |
please create a reproducible example and open a new issue |
I will do that if I'm able to make a reproducible example. 👍 |
🐛 Bug Report
Hello everyone, we were trying to pass some data for this json:
{"delete_board_modal_title" : "Delete {title}"}
in this way :
but it seems to not interpolate correctly the curly brace because I see this result
Delete {title}
.The weirdest thing is that if we use a local folder
public/locales/en_US.json
is working correctly but not when is fetching from this endpoint:https://ourBeautifulEndpoint.com/v2/en_US.json
.Or it also works like this:
<Trans i18nKey="Delete {title}" values={{ title: boardTitle }} />
or it works with the double curly braces but it's not what we want because we need ICU format.
Maybe we are missing something important for sure, what should we do?
This is the I18next config:
Environment
"i18next": "^21.8.9",
"i18next-browser-languagedetector": "^6.1.4",
"i18next-http-backend": "^1.4.1",
"i18next-icu": "^2.0.3"
}
Thanks in advice and sorry if this is not a bug or it is duplicated
The text was updated successfully, but these errors were encountered: