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

i18n to Contract Verification #5591

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

joeizang
Copy link
Collaborator

fixes #5522

@joeizang joeizang added the WIP label Dec 30, 2024
@joeizang joeizang self-assigned this Dec 30, 2024
Copy link

netlify bot commented Dec 30, 2024

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 45cf134
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/678142dad6aada0008185941
😎 Deploy Preview https://deploy-preview-5591--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@joeizang joeizang requested a review from ryestew January 7, 2025 14:26
@joeizang joeizang added ready-to-review PR ready to review and removed WIP labels Jan 7, 2025
@@ -102,7 +103,10 @@ export const ConstructorArguments: React.FC<ConstructorArgumentsProps> = ({ abiE
<div className="d-flex py-1 align-items-center custom-control custom-checkbox">
<input className="form-check-input custom-control-input" type="checkbox" id="toggleRawInputSwitch" checked={toggleRawInput} onChange={() => setToggleRawInput(!toggleRawInput)} />
<label className="m-0 form-check-label custom-control-label" style={{ paddingTop: '2px' }} htmlFor="toggleRawInputSwitch">
Enter raw ABI-encoded constructor arguments
<FormattedMessage
Copy link
Collaborator

Choose a reason for hiding this comment

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

is the default message needed? See Drafish's comment:

// There may have some un-translated content. Always fill in the gaps with EN JSON.
// No need for a defaultMessage prop when render a FormattedMessage component.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I noted that when going through the docs, but without the defaultMessage, there are console errors for every FormattedMessage block added. I will look into it and see

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@ryestew I noted from the error I get when the FormattedMessage tags are created without a defaultMessage prop that it falls back to using the id prop as the default. See this link which is the documentation page of the package we are using react-intl (scroll to the bottom to see code examples). In the examples shown, defaultMessage prop is used to give a fallback. So we might need to update our docs.

This here also shows the fallback behaviour of the libarary react-intl fallback behaviour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Contract Verification plugin needs to be setup with i18n
3 participants