Skip to content

Commit

Permalink
adding yml files for crowdin translations
Browse files Browse the repository at this point in the history
  • Loading branch information
andreclerigo committed Nov 18, 2024
1 parent 9d82630 commit 9dd25f2
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/crowdin-pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Crowdin Action

on:
push:
paths: [ "locals/**" ]
branches: [ "main" ]
workflow_run:
workflows: [ "CodeQL" ]
types:
- completed
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
crowdin:
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
localization_branch_name: l10n_crowdin_translations

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'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/crowdin-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Crowdin Action

on:
push:
branches: [ "main" ]
workflow_run:
workflows: [ "CodeQL" ]
types:
- completed
workflow_dispatch:

jobs:
crowdin:
runs-on: ubuntu-latest
steps:
- name: Crowdin push
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: true
download_translations: false
env:
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
13 changes: 13 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_Env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://api.crowdin.com"

"preserve_hierarchy": true

files: [
{
"source": "locales/en/messages.json",
"translation": "locales/%two_letters_code%/messages.json",
}
]
6 changes: 6 additions & 0 deletions locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extName": {
"message": "Duo Explained",
"description": "extension name."
}
}

0 comments on commit 9dd25f2

Please sign in to comment.