Skip to content

Commit 6d6638a

Browse files
authored
Update readme with pr guideline and new translation process (binary-com#6403)
* chore: update readme with pr guideline and new translation process * chore: remove redundant crowdin branch * And content formatting * Update README.md
1 parent 5f0747f commit 6d6638a

File tree

1 file changed

+31
-100
lines changed

1 file changed

+31
-100
lines changed

README.md

+31-100
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Deriv.com - An online trading platform that offers a wide selection of derivativ
1313
- [Pre-installation](#pre-installation)
1414
- [Quick start](#quick-start)
1515
- [How to contribute](#how-to-contribute)
16-
- [Base master](#base-master)
17-
- [Base Crowdin](#base-crowdin)
18-
- [Manage translations](#manage-translations)
16+
- [PR Formating guideline](#pr-formating-guideline)
17+
- [PR without translations](#pr-without-translation)
18+
- [PR with translations](#pr-with-translation)
1919
- [Manage releases](#manage-releases)
2020
- [Test link deployment](#test-link-deployment)
2121
- [FAQ](#faq)
@@ -94,9 +94,16 @@ Moreover, having these extensions will help you to speed up the development proc
9494

9595
## How to contribute
9696

97-
We have two types of PR (Pull request):
97+
To contribute in the project, we need to create PRs to master. We have two types of PRs (Pull request):
9898

99-
### Base **Master**
99+
### PR Formating guideline
100+
101+
1. Use the `{Developer}/{Clickup Card ID}/{Description}` format for PR titles. (e.g.: `[Dev's Name]/COJ-247/Align next-button on mt5 modal`).
102+
2. Start the description with a verb in an imperative declaration for clarity and conciseness. For example, "Fix issue with..." or "Implement feature to...".
103+
3. Add screenshots of change for easier reviewing (whenever applicable) and brief description
104+
4. Use Draft PRs if you don't mean to request for reviews yet. [Read more here.](https://github.blog/2019-02-14-introducing-draft-pull-requests/)
105+
106+
### PR without translation
100107
101108
PR will be based on the master branch if the commits are not having text changes
102109
@@ -110,7 +117,7 @@ PR will be based on the master branch if the commits are not having text changes
110117
111118
2. Make your changes
112119
113-
3. Make pull request
120+
3. Make pull request following PR formatting guidelines.
114121
115122
- Push your changes to your origin , add `-u` flag for the first time push
116123
@@ -122,45 +129,8 @@ PR will be based on the master branch if the commits are not having text changes
122129
123130
- Make sure to change the PR base to `master` branch
124131
125-
### Base Crowdin
126-
127-
PR will be based on crowdin branch if the commits are having text changes
128-
129-
1. Create branch from latest crowdin branch
130-
131-
- if you don't have crowdin branch
132-
133-
```sh
134-
git fetch upstream crowdin:crowdin
135-
git checkout crowdin
136-
git checkout -b [_your_branch_name]
137-
```
138-
139-
- if you have crowdin branch
140-
141-
```sh
142-
git checkout crowdin
143-
git pull upstream crowdin
144-
git checkout -b [_your_branch_name]
145-
```
146-
147-
2. Make your changes
148-
149-
- Commit your changes
150-
151-
3. Make pull request
152-
153-
- Push your changes to your origin, add `-u` flag for the first time push
154-
155-
```sh
156-
git push -u origin [_your_branch_name]
157-
```
158-
159-
- Click on the autogenerated link from terminal to open the PR
160-
161-
- Make sure to change the PR base to `crowdin` branch
162132
163-
## Manage translations
133+
### PR with translation
164134
165135
- Pre-requisite:
166136
@@ -173,37 +143,34 @@ PR will be based on crowdin branch if the commits are having text changes
173143
174144
- Set up your Crowdin API KEY in your .bash_profile or .zshrc
175145
176-
1. Extract translation
177-
178-
- Make sure you have the latest Crowdin changes, resolve conflicts if any
146+
- Creating Branch
179147
180148
```sh
181-
git pull upstream crowdin
182-
```
149+
npm run branch:create
150+
```
151+
Proceed by choosing Normal Translation
183152
184-
- Extract translation text to update `messages.json`
153+
- Download Translations
185154
186155
```sh
187-
npm run translate:extract
156+
npm run translation:pull
188157
```
158+
This command will trigger the workflow to pull latest translation from the specific branch and automatically add the commit to that PR.
189159
190-
2. Upload translation
160+
- Push the changes in the PR
191161
192-
- To upload source text to Crowdin (When task merge to crowdin branch)
162+
- Conflicts on message.json file
193163
194-
```sh
195-
npm run translate:upload
196-
```
164+
Don't worry it's easy to resolve, you can either resolve it using your changes or their changes doesn't matter because after you commit, it will again generate an updated messages.json file based on your current code, as long as you have all the changes from the master you are good to go.
197165
198-
3. Download translation
166+
Pulled the translations but strings are still not translated
167+
First you need to check if you have all the translations in your codebase.
168+
Search for the string and copy the corresponding hashed value for the string, can be found on messages.json
199169
200-
- To download/get the latest Crowdin translations
201-
202-
```sh
203-
npm run translate:download
204-
```
170+
Now search the whole codebase using the hash, if json files for each languages appeared on your search results then you check if the values are not in English.
171+
Once the translations are proven to be there, you need to check where the strings are used
172+
Usually if your are using localize function when not in the react component it is failing to translate strings properly, you can convert them to <Localize translate_text="" /> instead
205173
206-
**Note**: Don't forget to create a pull request to update crowdin branch
207174
208175
## Manage releases
209176
@@ -213,7 +180,6 @@ There are 2 types of releases:
213180
214181
Merging to master (squash and merge) will automatically release the last commit to the staging server https://staging.deriv.com
215182
216-
⚠️ If you want to release Crowdin changes, please make a PR from crowdin to master branch
217183
218184
2. Release to production:
219185
@@ -237,39 +203,4 @@ Example of release steps
237203
238204
## Test link deployment
239205
240-
There are two types of test link deployment preview:
241-
242-
1. Automatic deployment
243-
244-
Upon creating PR, [Vercel](https://vercel.com/) will auto-generate a test link inside the PR. you can use that to preview the test link for the changes you have made.
245-
246-
2. Manual deployment
247-
248-
If preferable to use manual deployment, you can use [gh-pages](https://pages.github.com/) functionality to create a test link. here are ways to do it:
249-
250-
- **Basic name.github.io/deriv-com/**
251-
252-
```sh
253-
npm run deploy-dev
254-
```
255-
256-
⚠️ This will remove your branch deployments
257-
258-
- **To a specific branch:**
259-
260-
```sh
261-
branch_name=fix_all_the_bugs npm run deploy-branch
262-
```
263-
264-
This will be deployed to name.github.io/deriv-com/br/fix_all_the_bugs
265-
266-
⚠️ You have to enable pathPrefix in gatsby-config for manual deployment, otherwise, the resources will not be uploaded to the site
267-
268-
## FAQ
269-
270-
- [how to create a new page?](documents/implementation-guide.md#create-new-page)
271-
- [how to insert an image?](documents/implementation-guide.md#image-component)
272-
- [how to style my element?](documents/implementation-guide.md#styled-component)
273-
- [Where to put my new component?](documents/file-structures.md)
274-
275-
⚠️ If you have more questions to add, please open a PR to add your question in FAQ section. The Answer will be on the PR reviews
206+
Upon creating PR, [Vercel](https://vercel.com/) and Cloudflare will auto-generate two test links inside the PR. you can use that to preview the test link for the changes you have made.

0 commit comments

Comments
 (0)