Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Update readme with pr guideline and new translation process (#6403)
Browse files Browse the repository at this point in the history
* chore: update readme with pr guideline and new translation process

* chore: remove redundant crowdin branch

* And content formatting

* Update README.md
  • Loading branch information
habib-deriv authored Jan 5, 2024
1 parent 5f0747f commit 6d6638a
Showing 1 changed file with 31 additions and 100 deletions.
131 changes: 31 additions & 100 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Deriv.com - An online trading platform that offers a wide selection of derivativ
- [Pre-installation](#pre-installation)
- [Quick start](#quick-start)
- [How to contribute](#how-to-contribute)
- [Base master](#base-master)
- [Base Crowdin](#base-crowdin)
- [Manage translations](#manage-translations)
- [PR Formating guideline](#pr-formating-guideline)
- [PR without translations](#pr-without-translation)
- [PR with translations](#pr-with-translation)
- [Manage releases](#manage-releases)
- [Test link deployment](#test-link-deployment)
- [FAQ](#faq)
Expand Down Expand Up @@ -94,9 +94,16 @@ Moreover, having these extensions will help you to speed up the development proc

## How to contribute

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

### Base **Master**
### PR Formating guideline

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`).
2. Start the description with a verb in an imperative declaration for clarity and conciseness. For example, "Fix issue with..." or "Implement feature to...".
3. Add screenshots of change for easier reviewing (whenever applicable) and brief description
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/)
### PR without translation
PR will be based on the master branch if the commits are not having text changes
Expand All @@ -110,7 +117,7 @@ PR will be based on the master branch if the commits are not having text changes
2. Make your changes
3. Make pull request
3. Make pull request following PR formatting guidelines.
- Push your changes to your origin , add `-u` flag for the first time push
Expand All @@ -122,45 +129,8 @@ PR will be based on the master branch if the commits are not having text changes
- Make sure to change the PR base to `master` branch
### Base Crowdin

PR will be based on crowdin branch if the commits are having text changes

1. Create branch from latest crowdin branch

- if you don't have crowdin branch
```sh
git fetch upstream crowdin:crowdin
git checkout crowdin
git checkout -b [_your_branch_name]
```
- if you have crowdin branch
```sh
git checkout crowdin
git pull upstream crowdin
git checkout -b [_your_branch_name]
```
2. Make your changes
- Commit your changes
3. Make pull request
- Push your changes to your origin, add `-u` flag for the first time push
```sh
git push -u origin [_your_branch_name]
```
- Click on the autogenerated link from terminal to open the PR
- Make sure to change the PR base to `crowdin` branch
## Manage translations
### PR with translation
- Pre-requisite:
Expand All @@ -173,37 +143,34 @@ PR will be based on crowdin branch if the commits are having text changes
- Set up your Crowdin API KEY in your .bash_profile or .zshrc
1. Extract translation
- Make sure you have the latest Crowdin changes, resolve conflicts if any
- Creating Branch
```sh
git pull upstream crowdin
```
npm run branch:create
```
Proceed by choosing Normal Translation
- Extract translation text to update `messages.json`
- Download Translations
```sh
npm run translate:extract
npm run translation:pull
```
This command will trigger the workflow to pull latest translation from the specific branch and automatically add the commit to that PR.
2. Upload translation
- Push the changes in the PR
- To upload source text to Crowdin (When task merge to crowdin branch)
- Conflicts on message.json file
```sh
npm run translate:upload
```
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.
3. Download translation
Pulled the translations but strings are still not translated
First you need to check if you have all the translations in your codebase.
Search for the string and copy the corresponding hashed value for the string, can be found on messages.json
- To download/get the latest Crowdin translations
```sh
npm run translate:download
```
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.
Once the translations are proven to be there, you need to check where the strings are used
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
**Note**: Don't forget to create a pull request to update crowdin branch
## Manage releases
Expand All @@ -213,7 +180,6 @@ There are 2 types of releases:
Merging to master (squash and merge) will automatically release the last commit to the staging server https://staging.deriv.com
⚠️ If you want to release Crowdin changes, please make a PR from crowdin to master branch
2. Release to production:
Expand All @@ -237,39 +203,4 @@ Example of release steps
## Test link deployment
There are two types of test link deployment preview:
1. Automatic deployment
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.
2. Manual deployment
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:
- **Basic name.github.io/deriv-com/**
```sh
npm run deploy-dev
```
⚠️ This will remove your branch deployments
- **To a specific branch:**
```sh
branch_name=fix_all_the_bugs npm run deploy-branch
```
This will be deployed to name.github.io/deriv-com/br/fix_all_the_bugs
⚠️ You have to enable pathPrefix in gatsby-config for manual deployment, otherwise, the resources will not be uploaded to the site
## FAQ
- [how to create a new page?](documents/implementation-guide.md#create-new-page)
- [how to insert an image?](documents/implementation-guide.md#image-component)
- [how to style my element?](documents/implementation-guide.md#styled-component)
- [Where to put my new component?](documents/file-structures.md)
⚠️ 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
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.

1 comment on commit 6d6638a

@vercel
Copy link

@vercel vercel bot commented on 6d6638a Jan 5, 2024

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

deriv-com – ./

deriv-com.binary.sx
deriv-com-git-master.binary.sx

Please sign in to comment.