-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
ReferenceInput label uses the wrong resource for translation message #7646
Comments
Please follow the issue template |
What you were expecting: What happened instead: Steps to reproduce: Other information: Environment
|
Reproduced, thanks! |
The problem is that, since we removed prop injection, the child of ReferenceInput has no way to access the original resource... That's a tough one. One solution would be to augment the ChoicesContext to store the original resource, but it's a bit hacky... The other solution would be to create a new context. But why would children of ReferenceInput read that context? Not a good one either. |
I may have a good solution. The idea is to invert the control of So Individual inputs would just pass the props they receive to This is a pretty large change, but I think it's the right way - it's, in fact, the continuation of what we've done in the 3.0 -> 4.0 migration. And it's backwards compatible. |
After thinking a bit about it, the previous version didn't make sense. It generated translation messages like |
The key use for translation is not |
right, I mixed it up, sorry. |
no it generate |
Fixed by #7110 |
ReferenceInput in react-admin@4.02 traduct field in the same way of react-admin@3.19
When editing a resource posts with the following field
<ReferenceInput source="idUser" reference="users"><AutoComplete /></ReferenceInput>
The ReferenceInput label will be traduct with the key resources.users.fields.idUser in react-admin@4, while react-admin@3.19 use resources.posts.fields.idUser
The ReferenceField use resources.posts.fields.idUser in react-admin@3.19 and react-admin@4.02
The text was updated successfully, but these errors were encountered: