mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 17:30:16 +01:00
🔄 chore: Refactor Locize Workflow for Improved Translation Sync (#5781)
This commit is contained in:
parent
3d0c27f525
commit
aea055b597
1 changed files with 10 additions and 11 deletions
21
.github/workflows/locize-i18n-sync.yml
vendored
21
.github/workflows/locize-i18n-sync.yml
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
name: Push New Keys & Create Translation PR
|
name: Sync Locize Translations & Create Translation PR
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -7,8 +7,8 @@ on:
|
||||||
types: [locize/versionPublished]
|
types: [locize/versionPublished]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
push-new-keys:
|
sync-translations:
|
||||||
name: Push Missing Translation Keys to locize
|
name: Sync Translation Keys with Locize
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
|
@ -22,23 +22,22 @@ jobs:
|
||||||
- name: Install locize CLI
|
- name: Install locize CLI
|
||||||
run: npm install -g locize-cli
|
run: npm install -g locize-cli
|
||||||
|
|
||||||
# Only push keys if this workflow was triggered by a push event.
|
# Sync translations (Push missing keys & remove deleted ones)
|
||||||
- name: Push Missing Translation Keys to locize
|
- name: Sync Locize with Repository
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
run: |
|
run: |
|
||||||
cd client/src/locales
|
cd client/src/locales
|
||||||
locize save-missing --api-key ${{ secrets.LOCIZE_API_KEY }} --project-id ${{ secrets.LOCIZE_PROJECT_ID }} --language en
|
locize sync --api-key ${{ secrets.LOCIZE_API_KEY }} --project-id ${{ secrets.LOCIZE_PROJECT_ID }} --language en
|
||||||
|
|
||||||
# When triggered by repository_dispatch, skip pushing new keys.
|
# When triggered by repository_dispatch, skip sync step.
|
||||||
- name: Skip push step on non-push events
|
- name: Skip sync step on non-push events
|
||||||
if: ${{ github.event_name != 'push' }}
|
if: ${{ github.event_name != 'push' }}
|
||||||
run: echo "Skipping push of new keys as the event is not a push."
|
run: echo "Skipping sync as the event is not a push."
|
||||||
|
|
||||||
create-pull-request:
|
create-pull-request:
|
||||||
name: Create Translation PR on Version Published
|
name: Create Translation PR on Version Published
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# This job will wait for push-new-keys to complete.
|
needs: sync-translations
|
||||||
needs: push-new-keys
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue