-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 3.31 KB
/
translate-strings.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Translate strings
on:
workflow_dispatch:
inputs:
platform:
description: 'Platform to translate strings for'
required: true
default: 'all'
type: choice
options:
- all
- android
- common
- ios
permissions:
contents: write
pull-requests: write
jobs:
formatCode:
name: DeepL translation job
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Translate common strings to supported languages
if: ${{ github.event.inputs.platform == 'common' || github.event.inputs.platform == 'all' }}
run: |
python translator.py \
--api_key $API_KEY \
--output_languages $OUTPUT_LANGUAGES \
--input_folder $INPUT_FOLDER \
--platform $PLATFORM
env:
API_KEY: ${{ secrets.DEEPL_API_KEY }}
OUTPUT_LANGUAGES: "ES,FR,DE,ZH,UK,JA,RU,AR,PT,IT,KO,NL,SV,PL,TR,DA,FI,EL,HU"
INPUT_FOLDER: "./shared/presentation/src/commonMain/composeResources/values"
PLATFORM: "common"
- name: Translate android strings to supported languages
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
run: |
python translator.py \
--api_key $API_KEY \
--output_languages $OUTPUT_LANGUAGES \
--input_folder $INPUT_FOLDER \
--platform $PLATFORM
env:
API_KEY: ${{ secrets.DEEPL_API_KEY }}
OUTPUT_LANGUAGES: "ES,FR,DE,ZH,UK,JA,RU,AR,PT,IT,KO,NL,SV,PL,TR,DA,FI,EL,HU"
INPUT_FOLDER: "./shared/presentation/src/androidMain/res/values"
PLATFORM: "android"
- name: Translate iOS strings to supported languages
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'all' }}
run: |
python translator.py \
--api_key $API_KEY \
--output_languages $OUTPUT_LANGUAGES \
--input_folder $INPUT_FOLDER \
--platform $PLATFORM
env:
API_KEY: ${{ secrets.DEEPL_API_KEY }}
OUTPUT_LANGUAGES: "ES,FR,DE,ZH,UK,JA,RU,AR,PT,IT,KO,NL,SV,PL,TR,DA,FI,EL,HU"
INPUT_FOLDER: "./iosApp"
PLATFORM: "ios"
- name: Add common strings to Git
if: ${{ github.event.inputs.platform == 'common' || github.event.inputs.platform == 'all' }}
run: git add shared/presentation/src/commonMain/composeResources/values*
- name: Add android strings to Git
if: ${{ github.event.inputs.platform == 'android' || github.event.inputs.platform == 'all' }}
run: git add shared/presentation/src/androidMain/res/values*
- name: Add ios strings to Git
if: ${{ github.event.inputs.platform == 'ios' || github.event.inputs.platform == 'all' }}
run: git add iosApp/Localizable.xcstrings
- name: Commit files
run: |
git config --local user.email ${{ vars.COMMITER_EMAIL }}
git config --local user.name ${{ vars.COMMITER_NAME }}
git commit -a -m "Github Action automatic translation of strings"
- name: GitHub Push
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}