Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 30 additions & 13 deletions .github/workflows/translate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,38 @@ name: Translate Readme

on:
push:
branches:
- main
- master
branches: [ master ]
paths:
- 'readme.md'

jobs:
build:
synchronize-with-crowdin:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Adding License
uses: dephraiim/translate-readme@v1
- name: Checkout
uses: actions/checkout@v3

- name: crowdin action
uses: crowdin/github-action@v1
with:
LANG: zh-CN # Simplified Chinese
# Change the language to your specified language.
# Upload sources to Crowdin
upload_sources: true
# Upload translations to Crowdin, only use true at initial run
upload_translations: true
# Download translations from Crowdin
download_translations: true
# To the specified branch
localization_branch_name: l10n_crowdin_translations
# Create pull request after pushing to branch
create_pull_request: true
pull_request_title: 'New Crowdin Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'master'
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
20 changes: 20 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."

"preserve_hierarchy": true

"files": [
{
"source": "readme.md",
"translation": "readme_%two_letters_code%.md",
"languages_mapping": {
"two_letters_code": {
"pt-BR": "pt-BR",
"zh-CN": "cn",
"ne-NP": "np",
"ko": "kr"
}
}
}
]