-
-
Notifications
You must be signed in to change notification settings - Fork 285
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
error in interpolation when language is set to "en_US" #1694
Comments
Locales should use In v4, |
@amannn I believe that's not why. All translations work with "_" (underscore) only interpolations do not work. If that were the case, all translations should stop working, right? ![]() I put a print. You can see that "Login" is working but the interpolation is not. |
But en-US or zh-CN doesn't work either, and the error message is: EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT ({locale, select, en {English} zh-CN {Chinese} other {Unknown}}) Nextjs15 + react19, with this example: https://github.com/amannn/next-intl/tree/main/examples/example-app-router |
Now, I use a temporary solution, hoping that the v4 version will support You can use the following solution for adaptation: selecter en.json |
I see your point, and I'd wish ICU select arguments would support dashes, but there are unfortunately two standards here that
I agree it's not ideal and I'm also using the |
Description
I'm trying to use next-intl but I run into a bug. My language is set to the "en_US" format. When we use the language in this format and try to do an interpolation, this error occurs:
Error: INVALID_MESSAGE: Incorrect locale information provided
I reproduced the error in this repository:
https://github.com/yardz/example-app-router-without-i18n-routing--error
It only has 3 commits.
The first is a copy of the example
example-app-router-without-i18n-routing
(the base example: https://github.com/amannn/next-intl/tree/main/examples/example-app-router-without-i18n-routing).The second commit is changing the name of the language files (even the second commit is working normally)
In the third commit I just add the variable for interpolation, then I start getting the error
Verifications
Mandatory reproduction URL
https://github.com/yardz/example-app-router-without-i18n-routing--error
Reproduction description
The quickest way to reproduce is:
Change the language files from "en" to "en_US" and "de" to "de_DE".
And make the necessary adjustments (this commit: yardz/example-app-router-without-i18n-routing--error@7d7c70a) ---- At this stage the example you provide is working normally ----
Then add a variable for interpolation (This commit: yardz/example-app-router-without-i18n-routing--error@b700d49)
Use this example as starting point: https://github.com/amannn/next-intl/tree/main/examples/example-app-router-without-i18n-routing
Expected behaviour
the interpolation works with file "en" but does not work with the pattern "en_US". I believe it should also work with the "en_US" pattern
The text was updated successfully, but these errors were encountered: