Skip to content

Commit

Permalink
Merge pull request #2020 from anbraten/use-crowdin-action
Browse files Browse the repository at this point in the history
Add crowdin action
  • Loading branch information
psonnera authored Oct 9, 2024
2 parents 2796ca5 + 794f662 commit 4cce5f9
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master

workflow_dispatch:

jobs:
Expand Down Expand Up @@ -47,7 +46,7 @@ jobs:
run: |
cd ${{ env.DOC_PATH }}
sphinx-build -T -E -n -v -w build_log.txt -q -b html -d _build/doctrees . _build/html
- name: Store build log
uses: actions/upload-artifact@v2
with:
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Tests

on:
push:
branches:
- master
workflow_dispatch:

jobs:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Update translations

on:
push:
branches:
- master
schedule:
- cron: '7 0 * * *' # every day at 00:07 UTC
workflow_dispatch:

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest
if: github.repository == 'openaps/AndroidAPSdocs'
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: l10n_translations
create_pull_request: true
pull_request_title: 'New translations'
pull_request_body: 'New translations'
pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
10 changes: 7 additions & 3 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
project_id: '310610'
api_token_env: CROWDIN_PERSONAL_TOKEN
preserve_hierarchy: true

files:
- source: /docs/EN/**/*.md
translation: /docs/CROWDIN/%two_letters_code%/**/%original_file_name%
translation: /docs/CROWDIN/%two_letters_code%/%original_path%/%original_file_name%
- source: /docs/EN/**/*.rst
translation: /docs/CROWDIN/%two_letters_code%/**/%original_file_name%
translation: /docs/CROWDIN/%two_letters_code%/%original_path%/%original_file_name%
- source: /docs/EN/images/**/*
translation: /docs/CROWDIN/%two_letters_code%/images/**/%original_file_name%
translation: /docs/CROWDIN/%two_letters_code%/images/%original_path%/%original_file_name%

0 comments on commit 4cce5f9

Please sign in to comment.