Update CONTRIBUTING.md

pull/5203/head
Elias Rad 2 months ago committed by Aniket
parent d9a4bc1bb8
commit 2d3a46db37
  1. 4
      CONTRIBUTING.md

@ -27,7 +27,7 @@ Then you can replace the string with a intl component. The `id` prop will be the
+ <FormattedMessage id="home.learn" /> + <FormattedMessage id="home.learn" />
</label> </label>
``` ```
In some cases, jsx maybe not acceptable, you can use `intl.formatMessage` . In some cases, jsx maybe not be acceptable, you can use `intl.formatMessage` .
```jsx ```jsx
<input <input
ref={searchInputRef} ref={searchInputRef}
@ -92,7 +92,7 @@ But in some cases, the `id` prop may not be static. For example,
<FormattedMessage id={plugin?.profile.name + '.displayName'} defaultMessage={plugin?.profile.displayName || plugin?.profile.name} /> <FormattedMessage id={plugin?.profile.name + '.displayName'} defaultMessage={plugin?.profile.displayName || plugin?.profile.name} />
</h6> </h6>
``` ```
You can't be sure there is a match key in locale file or not. So it will be better to provide a `defaultMessage` prop. You can't be sure whether there is a match key in locale file or not. So it will be better to provide a `defaultMessage` prop.
### Should I update the non-english locale json files? ### Should I update the non-english locale json files?
You probably will have this question when you are updating the english locale json files. You probably will have this question when you are updating the english locale json files.

Loading…
Cancel
Save