Skip to content

Commit

Permalink
fix: auto push translations
Browse files Browse the repository at this point in the history
  • Loading branch information
abuaboud committed Nov 13, 2023
1 parent 421cc79 commit 3f453a5
Show file tree
Hide file tree
Showing 8 changed files with 13,264 additions and 5,056 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Crowdin Action

on:
push:
branches: [ main ]

jobs:
synchronize-with-crowdin:
runs-on: ubuntu-latest

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

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install dependencies
run: npm ci --ignore-scripts

- name: build packages
run: npx nx run-many --target=extract-i18n --projects=ui-core

- name: crowdin action
uses: crowdin/github-action@v1
with:
upload_sources: true
upload_translations: false
download_translations: true
localization_branch_name: l10n_crowdin_translations
create_pull_request: true
pull_request_title: 'feat(crowdin): New Translations'
pull_request_body: 'New Crowdin translations by [Crowdin GH Action](https://github.com/crowdin/github-action)'
pull_request_base_branch_name: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GH_ABUABOUD_TOKEN }}
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
32 changes: 32 additions & 0 deletions crowdin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Your Crowdin credentials
#
"project_id_env": "CROWDIN_PROJECT_ID"
"api_token_env": "CROWDIN_PERSONAL_TOKEN"
"base_path": "."
"base_url": "https://api.crowdin.com"

#
# Choose file structure in Crowdin
# e.g. true or false
#
"preserve_hierarchy": true

#
# Files configuration
#
files: [
{
#
# Source files filter
# e.g. "/resources/en/*.json"
#
"source": "packages/ui/core/src/locale/messages.xlf",

#
# Where translations will be placed
# e.g. "/resources/packages/ui/core/src/locale%two_letters_code%/%original_file_name%"
#
"translation": "packages/ui/core/src/locale/messages.%two_letters_code%.xlf",
}
]
4 changes: 3 additions & 1 deletion packages/ui/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@
"baseHref": ""
},
"locales": {
"fr": "packages/ui/core/src/locale/messages.fr.xlf"
"fr": "packages/ui/core/src/locale/messages.fr.xlf",
"jp": "packages/ui/core/src/locale/messages.jp.xlf",
"de": "packages/ui/core/src/locale/messages.de.xlf"
}
}
}
3,965 changes: 3,965 additions & 0 deletions packages/ui/core/src/locale/messages.de.xlf

Large diffs are not rendered by default.

5,491 changes: 2,432 additions & 3,059 deletions packages/ui/core/src/locale/messages.fr.xlf

Large diffs are not rendered by default.

3,965 changes: 3,965 additions & 0 deletions packages/ui/core/src/locale/messages.ja.xlf

Large diffs are not rendered by default.

Loading

0 comments on commit 3f453a5

Please sign in to comment.