mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
fix: Using Crowdin action implement translation sync
Signed-off-by: ErikQQY <2283984853@qq.com>
This commit is contained in:
parent
ded859aebc
commit
07178a7125
51
.github/workflows/sync.yml
vendored
51
.github/workflows/sync.yml
vendored
@ -1,38 +1,35 @@
|
|||||||
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
name: Crowdin Action
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
synchronize-with-crowdin:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
|
||||||
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [12.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v2
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
- run: |
|
|
||||||
cd web
|
|
||||||
npm install
|
|
||||||
npm run crowdin:sync
|
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: crowdin action
|
||||||
|
uses: crowdin/github-action@1.2.0
|
||||||
with:
|
with:
|
||||||
commit_message: Sync from crowdin
|
upload_translations: true
|
||||||
file_pattern: web/src/locales/*
|
|
||||||
commit_author: ${{ secrets.CROWDIN_BOT }}
|
download_translations: true
|
||||||
|
push_translations: true
|
||||||
|
commit_message: 'New Crowdin translation by Github Action'
|
||||||
|
|
||||||
|
localization_branch_name: l10n_crowdin_action
|
||||||
|
create_pull_request: true
|
||||||
|
pull_request_title: 'New Crowdin translations'
|
||||||
|
|
||||||
|
crowdin_branch_name: l10n_branch
|
||||||
|
config: './web/crowdin.yml'
|
||||||
|
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
CROWDIN_PROJECT_ID: '463556'
|
||||||
|
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
|
@ -4,7 +4,7 @@ preserve_hierarchy: true
|
|||||||
files: [
|
files: [
|
||||||
# JSON translation files
|
# JSON translation files
|
||||||
{
|
{
|
||||||
source: '/src/locales/en/**/*',
|
source: '/web/src/locales/en/data.json',
|
||||||
translation: '/src/locales/%two_letters_code%/**/%original_file_name%',
|
translation: '/web/src/locales/%two_letters_code%/data.json',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user