AAE-24008 Crowdin sync implementation (#10309)

* AAE-24008 Crowdin implementation

* removed new line from pull-from-crowdin.yml

Co-authored-by: Anahide Tchertchian <608958+atchertchian@users.noreply.github.com>

---------

Co-authored-by: Anahide Tchertchian <608958+atchertchian@users.noreply.github.com>
This commit is contained in:
Ruggero Corsaletti 2024-10-21 12:20:20 +02:00 committed by GitHub
parent bbea2d80e5
commit 1d739ed15a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 64 additions and 0 deletions

View File

@ -198,6 +198,13 @@ module.exports = {
files: ['*.ts'], files: ['*.ts'],
extends: ['plugin:@angular-eslint/template/process-inline-templates'], extends: ['plugin:@angular-eslint/template/process-inline-templates'],
excludedFiles: ['*.spec.ts'] excludedFiles: ['*.spec.ts']
},
{
files: ['*.json'],
parser: 'jsonc-eslint-parser',
rules: {
'comma-dangle': ['error', 'never']
}
} }
], ],

23
.github/workflows/pull-from-crowdin.yml vendored Normal file
View File

@ -0,0 +1,23 @@
name: Pull Translations from Crowdin
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
pull-from-crowdin:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Pull translations from Crowdin
uses: crowdin/github-action@6ed209d411599a981ccb978df3be9dc9b8a81699 # v2.1.1
with:
upload_sources: false
download_translations: true
create_pull_request: true
localization_branch_name: automated-translations-update
pull_request_title: "GH auto: Automated Update of Translations from Crowdin"
pull_request_base_branch_name: develop
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}

View File

@ -185,6 +185,27 @@ jobs:
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- uses: ./.github/actions/npm-check-bundle - uses: ./.github/actions/npm-check-bundle
push-translation-keys-to-crowdin:
name: Push translations keys to Crowdin
if: ${{ github.ref == 'refs/heads/develop' }}
runs-on: ubuntu-latest
needs: [ initialization, build ]
permissions:
contents: read
packages: read
actions: read
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Push Source Files to Crowdin
uses: crowdin/github-action@6ed209d411599a981ccb978df3be9dc9b8a81699 # v2.1.1
with:
upload_sources: true
upload_sources_args: --delete-obsolete
env:
CROWDIN_TOKEN: ${{ secrets.CROWDIN_TRANSLATIONS_TOKEN }}
finalize: finalize:
if: always() if: always()
runs-on: ubuntu-latest runs-on: ubuntu-latest

13
crowdin.yml Normal file
View File

@ -0,0 +1,13 @@
"project_id": "11"
"api_token_env": "CROWDIN_TOKEN"
"base_path": "."
"base_url": "https://hyland.api.crowdin.com"
"preserve_hierarchy": true
"files": [
{
"source": "/**/**/i18n/en.json",
"translation": "/%original_path%/%two_letters_code%.%file_extension%",
"export_only_approved": "true",
"update_option": "update_as_unapproved"
}
]