@deriv-com/translations 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ This is a localization library that uses `i18next`, `react-i18next`, and a custo
|
|
|
13
13
|
- [~~`localize`~~](#localize-example)
|
|
14
14
|
- [`useTranslations` Hook](#usetranslations-hook)
|
|
15
15
|
- [Syncing translations to CDN](#syncing-translations)
|
|
16
|
+
- [Example usage of the action in the workflow file](#example-usage-of-the-action-in-the-workflow-file)
|
|
16
17
|
- [Contributing](#contributing)
|
|
17
18
|
|
|
18
19
|
## Overview
|
|
@@ -120,6 +121,7 @@ There is a github action that syncs the translations from Crowdin to the CDN.
|
|
|
120
121
|
|
|
121
122
|
The action takes following inputs:
|
|
122
123
|
|
|
124
|
+
- `PROJECT_SOURCE_DIRECTORY`: Source directory of your project by default it is `src`
|
|
123
125
|
- `CROWDIN_BRANCH_NAME`: Running on production, test or staging etc
|
|
124
126
|
- `CROWDIN_PROJECT_ID`: Crowdin project ID which can be found in the crowdin project settings
|
|
125
127
|
- `CROWDIN_PERSONAL_TOKEN`: Crowdin personal token which can be found in the crowdin account settings
|
|
@@ -130,6 +132,35 @@ The action takes following inputs:
|
|
|
130
132
|
|
|
131
133
|
Refer to the action file [here](https://github.com/deriv-com/translations/blob/main/.github/actions/extract_and_sync_translations/action.yml)
|
|
132
134
|
|
|
135
|
+
### Example usage of the action in the workflow file:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
name: Sync translations
|
|
139
|
+
|
|
140
|
+
on:
|
|
141
|
+
push:
|
|
142
|
+
branches:
|
|
143
|
+
- 'main'
|
|
144
|
+
|
|
145
|
+
jobs:
|
|
146
|
+
sync_translations:
|
|
147
|
+
runs-on: ubuntu-latest
|
|
148
|
+
steps:
|
|
149
|
+
- name: Checkout to main branch
|
|
150
|
+
uses: actions/checkout@v3
|
|
151
|
+
|
|
152
|
+
- name: Sync translations
|
|
153
|
+
uses: deriv-com/translations/.github/actions/extract_and_sync_translations@main
|
|
154
|
+
with:
|
|
155
|
+
CROWDIN_BRANCH_NAME: ${{ secrets.CROWDIN_BRANCH_NAME }}
|
|
156
|
+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
|
|
157
|
+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
158
|
+
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
|
|
159
|
+
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
160
|
+
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
161
|
+
R2_BUCKET_NAME: ${{ secrets.R2_BUCKET_NAME }}
|
|
162
|
+
```
|
|
163
|
+
|
|
133
164
|
## Contributing
|
|
134
165
|
|
|
135
166
|
Contributions are welcome. Please open a pull request with your changes.
|
package/package.json
CHANGED