Skip to content

Fix "Missing translation" console error when the dataProvider fails - #5655

Merged
djhi merged 2 commits into
masterfrom
fix-notify-missing-translation
Dec 11, 2020
Merged

Fix "Missing translation" console error when the dataProvider fails#5655
djhi merged 2 commits into
masterfrom
fix-notify-missing-translation

Conversation

@fzaninotto

Copy link
Copy Markdown
Member

Problem

Server error messages are seldom translated. And the useNotify hook logs a warning in the console for every missing translation. This pollutes the console a great deal and harms developer experience.

Solution

Provide default translation for dataProvider error notifications (the untranslated message). This will remove the warnings for untranslated server errors.

We do this in every call to useNotify in return to dataProvider errors instead of in useNotify itself, because useNotify is often called with error codes that need to be identified as mission transltions.

Before

image

After

image

@fzaninotto fzaninotto added the RFR Ready For Review label Dec 11, 2020

@djhi djhi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@djhi djhi added this to the 3.11 milestone Dec 11, 2020
@djhi
djhi merged commit be749b7 into master Dec 11, 2020
@djhi
djhi deleted the fix-notify-missing-translation branch December 11, 2020 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants