@deriv-com/translations 1.1.0 → 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 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
@@ -7,7 +7,7 @@
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
9
9
  "bin": {
10
- "extract-translations": "./dist/extract-translations.cjs"
10
+ "deriv-extract-translations": "./dist/deriv-extract-translations.cjs"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -16,10 +16,10 @@
16
16
  }
17
17
  },
18
18
  "private": false,
19
- "version": "1.1.0",
19
+ "version": "1.1.2",
20
20
  "scripts": {
21
21
  "dev": "vite",
22
- "build": "tsc && vite build && cp ./src/scripts/extract-translations.cjs ./dist/extract-translations.cjs",
22
+ "build": "tsc && vite build && cp ./src/scripts/deriv-extract-translations.cjs ./dist/deriv-extract-translations.cjs",
23
23
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
24
24
  "test": "vitest ./src/__tests__/*.test.tsx",
25
25
  "prepublish": "npm run test && npm run build"