You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
-[PR without translations](#pr-without-translation)
18
+
-[PR with translations](#pr-with-translation)
19
19
-[Manage releases](#manage-releases)
20
20
-[Test link deployment](#test-link-deployment)
21
21
-[FAQ](#faq)
@@ -94,9 +94,16 @@ Moreover, having these extensions will help you to speed up the development proc
94
94
95
95
## How to contribute
96
96
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):
98
98
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
100
107
101
108
PR will be based on the master branch if the commits are not having text changes
102
109
@@ -110,7 +117,7 @@ PR will be based on the master branch if the commits are not having text changes
110
117
111
118
2. Make your changes
112
119
113
-
3. Make pull request
120
+
3. Make pull request following PR formatting guidelines.
114
121
115
122
- Push your changes to your origin , add `-u` flag for the first time push
116
123
@@ -122,45 +129,8 @@ PR will be based on the master branch if the commits are not having text changes
122
129
123
130
- Make sure to change the PR base to `master` branch
124
131
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
162
132
163
-
## Manage translations
133
+
### PR with translation
164
134
165
135
- Pre-requisite:
166
136
@@ -173,37 +143,34 @@ PR will be based on crowdin branch if the commits are having text changes
173
143
174
144
- Set up your Crowdin API KEY in your .bash_profile or .zshrc
175
145
176
-
1. Extract translation
177
-
178
-
- Make sure you have the latest Crowdin changes, resolve conflicts if any
146
+
- Creating Branch
179
147
180
148
```sh
181
-
git pull upstream crowdin
182
-
```
149
+
npm run branch:create
150
+
```
151
+
Proceed by choosing Normal Translation
183
152
184
-
- Extract translation text to update `messages.json`
153
+
- Download Translations
185
154
186
155
```sh
187
-
npm run translate:extract
156
+
npm run translation:pull
188
157
```
158
+
This command will trigger the workflow to pull latest translation from the specific branch and automatically add the commit to that PR.
189
159
190
-
2. Upload translation
160
+
- Push the changes in the PR
191
161
192
-
- To upload source text to Crowdin (When task merge to crowdin branch)
162
+
- Conflicts on message.json file
193
163
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.
197
165
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
199
169
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
205
173
206
-
**Note**: Don't forget to create a pull request to update crowdin branch
207
174
208
175
## Manage releases
209
176
@@ -213,7 +180,6 @@ There are 2 types of releases:
213
180
214
181
Merging to master (squash and merge) will automatically release the last commit to the staging server https://staging.deriv.com
215
182
216
-
⚠️ If you want to release Crowdin changes, please make a PR from crowdin to master branch
217
183
218
184
2. Release to production:
219
185
@@ -237,39 +203,4 @@ Example of release steps
237
203
238
204
## Test link deployment
239
205
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