-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3273 from LiteFarmOrg/add-crowdin-action-to-main
LF-4276 - checkout new action files to main
- Loading branch information
Showing
2 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Crowdin Download Action | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
download-translations: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Synchronize with Crowdin | ||
uses: crowdin/github-action@v2 | ||
with: | ||
upload_sources: false | ||
upload_translations: false | ||
download_translations: true | ||
skip_untranslated_strings: true | ||
export_only_approved: true | ||
source: packages/webapp/public/locales/en/*.json # Sources pattern | ||
translation: packages/webapp/public/locales/%two_letters_code%/%original_file_name% # Translations pattern | ||
localization_branch_name: l10n_crowdin_translations_${{ env.BRANCH_NAME }} | ||
create_pull_request: true | ||
pull_request_title: "New Crowdin translations" | ||
pull_request_body: "New Crowdin pull request with translations" | ||
pull_request_base_branch_name: ${{ env.BRANCH_NAME }} | ||
crowdin_branch_name: ${{ env.BRANCH_NAME }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CROWDIN_TEMP_PERSONAL_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Crowdin Upload Action | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- integration | ||
paths: | ||
- "**/locales/**.md" | ||
- "**/locales/**.json" | ||
|
||
jobs: | ||
synchronize-translations: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 1 # Should be 1 to avoid parallel builds | ||
matrix: | ||
locales: [ | ||
# Frontend core translations | ||
{ | ||
source: packages/webapp/public/locales/en/*.json, | ||
translation: packages/webapp/public/locales/%two_letters_code%/%original_file_name%, | ||
}, | ||
# Consent Forms | ||
{ | ||
source: packages/webapp/src/containers/Consent/locales/en/*.md, | ||
translation: packages/webapp/src/containers/Consent/locales/%two_letters_code%/%original_file_name%, | ||
}, | ||
# Backend tranlsations - skipping pdf (crop.json is copied jobs scheduler init during build) | ||
{ | ||
source: packages/api/src/jobs/locales/en/*.json, | ||
translation: packages/api/src/jobs/locales/%two_letters_code%/%original_file_name%, | ||
}, | ||
# email templates | ||
{ | ||
source: packages/api/src/templates/locales/en.json, | ||
translation: packages/api/src/templates/locales/%two_letters_code%.%file_extension%, | ||
}, | ||
] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Crowdin sync | ||
uses: crowdin/github-action@v2 | ||
with: | ||
upload_sources: true | ||
upload_translations: true | ||
upload_sources_args: --preserve-hierarchy | ||
upload_translations_args: --preserve-hierarchy | ||
download_translations: false | ||
auto_approve_imported: false | ||
import_eq_suggestions: true | ||
crowdin_branch_name: ${{ env.BRANCH_NAME }} | ||
source: ${{ matrix.locales.source }} # Sources pattern | ||
translation: ${{ matrix.locales.translation }} # Translations pattern | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.CROWDIN_TEMP_PERSONAL_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }} | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |