Skip to content
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

feat: add translate in emptyText on ra-ui-material fields #8132

Merged
merged 4 commits into from Sep 8, 2022

Conversation

ogustavo-pereira
Copy link
Contributor

@ogustavo-pereira ogustavo-pereira commented Sep 1, 2022

Implementing the emptyTextt translation feature for issue #8044

I added useTranslate to always translate emptyText, if it doesn't find the translation it will display the text normally

  • Code ✅
  • Test ❌
  • Documentation ❌

I was wondering what is expected of me to document and which test I should add. Can you help me @fzaninotto?

Closes #8044

@fzaninotto
Copy link
Member

I was wondering what is expected of me to document and which test I should add. Can you help me @fzaninotto?

Sure!

Each Field component has a corresponding .spec.tsx file. You should add one test case in each of these files, to check that, given an i18nProvider with the right translation, a field component with no corresponding value in the record renders the translated text. If there is also a story file, start by adding a story for that use case (take LocalesMenuButton.stories as an example) to be able to test visually.

As for the documentation, add a line to https://marmelab.com/react-admin/Fields.html#emptytext saying that the provided emptyText is translated.

@ogustavo-pereira
Copy link
Contributor Author

Thank you I will make the requests

Update

  • Code ✅
  • Test ❌
  • Documentation 736b9ab
  • Storybook ❌

@ogustavo-pereira
Copy link
Contributor Author

@fzaninotto I Resolved all points raised. I think I will need a review to check if it was executed in the best way

Update

@fzaninotto fzaninotto merged commit ee731bc into marmelab:next Sep 8, 2022
@fzaninotto
Copy link
Member

Excellent, thanks a lot!

@fzaninotto fzaninotto added this to the 4.4.0 milestone Sep 8, 2022
fzaninotto added a commit that referenced this pull request Sep 12, 2022
Seojun-Park pushed a commit to Seojun-Park/react-admin that referenced this pull request Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants