Skip to content

Commit

Permalink
ELEMENTS-1429: add crowdin sync workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
richardsd committed Jul 5, 2022
1 parent 388a10c commit 97a8e36
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/crowdin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Workflow that syncronizes translations from Crowdin
name: Crowdin Sync

on:
# Check for updates every day
schedule:
- cron: '0 0 * * *'

# Sync when a commit is done on maintenance-3.0.x
push:
branches:
- maintenance-3.0.x
paths:
- 'ui/i18n/messages.json'

jobs:
crowdin:
runs-on: ubuntu-latest

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

- name: Crowdin Action
uses: crowdin/[email protected]
with:
# Tokens
project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
token: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
# Load external configuration file (to support translation rename)
config: crowdin-conf.yml

# Upload sources for translation
upload_sources: true

# Auto-approve reference sentences we are pushing (english)
auto_approve_imported: true

# Name of the branch where to merge the translations
localization_branch_name: maintenance-3.0.x

# The commit message
commit_message: 'Automatic update of translations from Crowdin'

# Automatically download all the new translations
download_translations: true

# User properties
github_user_name: nuxeo-web-ui-jx-bot
github_user_email: [email protected]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14 changes: 14 additions & 0 deletions crowdin-conf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"preserve_hierarchy": true
"files": [
{
"source": "/ui/i18n/messages.json",
"translation": "/ui/i18n/messages-%two_letters_code%.json",
"translation_replace": {
"-es": "-es-ES",
"-pt": "-pt-PT",
"-sv": "-sv-SE",
"-zh": "-zh-CN",
},
"dest" : "/nuxeo-ui-elements/messages.json",
}
]

0 comments on commit 97a8e36

Please sign in to comment.