-
-
Notifications
You must be signed in to change notification settings - Fork 193
60 lines (55 loc) · 2 KB
/
tranlate-languages.yml
File metadata and controls
60 lines (55 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Generating Translations For strings
on:
push:
branches: [ main ]
jobs:
build-tasks:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Building phoenix
env:
CORE_AI_TRANSLATE_API_KEY: ${{ secrets.CORE_AI_TRANSLATE_API_KEY }}
run: |
npm ci
npm run _translateStrings
ls -al src/nls
shell: bash
- name: Check translation errors file
id: check-errors
run: |
ERRORS=""
if [ -f src/nls/errors.txt ]; then
ERRORS="true"
fi
if [ -f src-mdviewer/src/md-nls-autogenerated/errors.txt ]; then
ERRORS="true"
fi
if [ -n "$ERRORS" ]; then
echo "errors_found=true" >> $GITHUB_ENV
else
echo "errors_found=false" >> $GITHUB_ENV
fi
- name: Create Translation Pull Request
id: cpr
uses: peter-evans/create-pull-request@v4
with:
commit-message: 'ci: update Translations'
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
title: '[Translations BOT] Update String translations'
add-paths: |
src/nls/**
src-mdviewer/src/md-nls-autogenerated/**
src-mdviewer/src/locales/**
body: |
Update string translations
- Auto-generated by `tranlate-languages.yml` action
- Includes Phoenix NLS (`src/nls/`) and mdviewer locales (`src-mdviewer/src/locales/`)
Errors:
${{ env.errors_found == 'true' && 'Errors: Some errors were found, please see GitHub Actions logs.' || 'No Translation Errors. All good!' }}
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"