Skip to content

Commit

Permalink
Merge pull request #5507 from ethereum/contrib1
Browse files Browse the repository at this point in the history
update Contributing.md
  • Loading branch information
Aniket-Engg authored Dec 21, 2024
2 parents 01a2d65 + 9dd89bc commit a6da846
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
# Contributing

Everyone is very welcome to contribute on the codebase of Remix. Please join our [Discord](https://discord.gg/mh9hFCKkEq) in case of any queries.
Everyone is welcome to contribute to Remix's codebase and please join our [Discord](https://discord.gg/mh9hFCKkEq).

## Development
Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a readme to explain its application.
Remix libraries work closely with [Remix IDE](https://remix.ethereum.org). Each library has a README to explain its application.

When you add code in any library, please ensure you add related unit tests.
When you add code to a library, please add related unit tests.

## Coding style

Please conform to [standard](https://standardjs.com/) for code styles.
Use [JavaScript Standard Style](https://standardjs.com/) for the coding style.

## Submitting Pull Requests
Please follow GitHub's standard model of making changes & submitting pull request which is very well explained [here](https://guides.github.com/activities/forking/). Make sure your code works fine locally before submitting a pull request.
Follow GitHub's standard model of making changes & submitting pull requests - explained [here](https://guides.github.com/activities/forking/). Please make sure your code works locally before submitting a pull request.

## Internationalization
Remix now supports Internationalization. Everyone is welcome to contribute to this feature.
Remix supports Internationalization.

### How to make a string support intl?
### How to contribute translations?
Remix uses CrowdIn to manage translations. Please DO NOT make a PR on GitHub with translation. To contribute, make an account on [CrowdIn](https://accounts.crowdin.com/register).

Remix has four projects on CrowdIn
1. [RemixUI](https://crowdin.com/project/remix-ui/) - for translating Remix's User Interface
2. [Remix Docs](https://crowdin.com/project/remix-translation) - for translating Remix's [Documentation](https://remix-ide.readthedocs.io)
3. [LearnEth](https://crowdin.com/project/remix-learneth) - for translating the tutorials in Remix's tutorial plugin called [Learneth](https://remix.ethereum.org/?#activate=solidity,solidityUnitTesting,LearnEth)
4. [Remix Project Website](https://crowdin.com/project/361d7e8c3b07220fa22e9d5a901b0021) - for translating the info site about [Remix](https://remix-project.org/)

There are many languages, for each project. But if you do not see your desired language, send us a note on CrowdIn or in the Remix Discord.

In addition to writing translations, you can also review other's work.

### How to make your plugin suport string internationalization?
First, put the string in the locale file located under `apps/remix-ide/src/app/tabs/locales/en`.
Each json file corresponds to a module. If the module does not exist, then create a new json and import it in the `index.js`.
Then you can replace the string with an intl component. The `id` prop will be the key of this string.
Expand Down Expand Up @@ -80,34 +93,22 @@ You can find the language's `code, name, localeName` in this link
https://github.com/ethereum/ethereum-org-website/blob/dev/i18n.config.json

### Whether or not to use `defaultMessage`?
If you search `FormattedMessage` or `intl.formatMessage` in this project, you will notice that most of them only have a `id` prop, but a few of them have a `defaultMessage` prop.
If you search `FormattedMessage` or `intl.formatMessage` in this project, you will notice that most only have a `id` prop, but a few of them have a `defaultMessage` prop.

**Why?**

Each non-english language will be filled in the gaps with english. Even though there may be some untranslated content, it will always use english as defaultMessage. That's why we don't need to provide a `defaultMessage` prop each time we render a `FormattedMessage` component.
The gaps in an incomplete non-English language will be filled with English. The un-translated content will use English as defaultMessage. That's why we don't need to provide a `defaultMessage` prop each time we render a `FormattedMessage` component.

But in some cases, the `id` prop may not be static. For example,
```jsx
<h6 className="pt-0 mb-1" data-id='sidePanelSwapitTitle'>
<FormattedMessage id={plugin?.profile.name + '.displayName'} defaultMessage={plugin?.profile.displayName || plugin?.profile.name} />
</h6>
```
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?
You probably will have this question when you are updating the english locale json files.
Well, that depends.
If you update an old json file, then you don't need to update it in other languages, because crowdin will do it for you.
But if you add a new json file, only English is needed.
### How to contribute on translations?
Remix is using crowdin to manage translations. If you want to contribute on that, you can do it on crowdin. Check the link below.
https://crowdin.com/project/remix-translation
Because you can't be sure if there is a matched key in the locale file, its better to provide a `defaultMessage` prop.
There are many languages, just get into your language, and you will see a folder named `Remix UI`, where you can do the translations.
### Should I update the non-English locale json files?
When you are updating an existing English locale json file, then you don't need to add any other languages, because CrowdIn will do it for you.
Not only you can do the translations, you can also review it. If you agree or disagree with some translations, you can vote YES or NO. If you vote NO, you can comment to explain why you vote NO, and give your translation.
But if you add a new json file, only then English is needed.

0 comments on commit a6da846

Please sign in to comment.