Skip to content

Commit

Permalink
Merge pull request #90 from ScienceCore/main
Browse files Browse the repository at this point in the history
Enable translation workflow
  • Loading branch information
jnywong committed Sep 17, 2024
2 parents 9d4c037 + 954dcc6 commit 0f63e27
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/crowdin_download.yml
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 }}
37 changes: 37 additions & 0 deletions .github/workflows/crowdin_upload.yml
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 }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# NASA TOPS-T Reproducibly Analyzing Wildfire, Drought, and Flood Risk with NASA Earthdata Cloud

>[!WARNING]
>Repo not in use and for testing only.
![banner](assets/banner.jpg)

Using NASA Earthdata Cloud data to assess the risk of wildfire, drought, and flood.
Expand Down
23 changes: 23 additions & 0 deletions crowdin.yml
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%

0 comments on commit 0f63e27

Please sign in to comment.