-
Notifications
You must be signed in to change notification settings - Fork 5
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 #90 from ScienceCore/main
Enable translation workflow
- Loading branch information
Showing
4 changed files
with
104 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,41 @@ | ||
name: Download translations from Crowdin | ||
|
||
on: | ||
schedule: | ||
- cron: '0 2 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Crowdin download action | ||
uses: crowdin/github-action@v1 | ||
with: | ||
upload_sources: false | ||
upload_translations: false | ||
download_translations: true | ||
localization_branch_name: l10n | ||
crowdin_branch_name: climate_risk | ||
skip_untranslated_files: true | ||
export_only_approved: true | ||
config: ./crowdin.yml | ||
create_pull_request: true | ||
pull_request_title: 'New Crowdin translations' | ||
pull_request_body: 'New Crowdin pull request with translations' | ||
pull_request_base_branch_name: 'main' | ||
pull_request_labels: 'localization' | ||
pull_request_assignees: 'crowdin-bot' | ||
pull_request_reviewers: 'jnywong' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} |
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,37 @@ | ||
name: Upload sources to Crowdin | ||
|
||
on: | ||
push: | ||
paths: | ||
- book/** | ||
- README.md | ||
- CONTRIBUTING.md | ||
- CONDUCT.md | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
synchronize-with-crowdin: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Crowdin upload action | ||
uses: crowdin/github-action@v1 | ||
with: | ||
upload_sources: true | ||
upload_translations: false | ||
download_translations: false | ||
localization_branch_name: l10n | ||
crowdin_branch_name: climate_risk | ||
config: ./crowdin.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }} | ||
CROWDIN_API_TOKEN: ${{ secrets.CROWDIN_API_TOKEN }} |
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
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,23 @@ | ||
# | ||
# Your Crowdin credentials | ||
# | ||
project_id_env: &project_id CROWDIN_PROJECT_ID | ||
api_token_env: CROWDIN_API_TOKEN | ||
project_id: *project_id | ||
base_path: "." | ||
base_url: "https://api.crowdin.com" | ||
# | ||
# Choose file structure in Crowdin | ||
# e.g. true or false | ||
# | ||
preserve_hierarchy: true | ||
# | ||
# Files configuration | ||
# | ||
files: | ||
- source: /*.md | ||
dest: /%original_file_name% | ||
translation: /%locale%/%original_file_name% | ||
- source: /book/**/*.md | ||
dest: /book/**/%original_file_name% | ||
translation: /book/%locale%/**/%original_file_name% |