generated from custom-cards/boilerplate-card
-
-
Notifications
You must be signed in to change notification settings - Fork 33
45 lines (39 loc) · 1.32 KB
/
translate.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
name: 'Translate strings'
on:
push:
branches-ignore:
- main
jobs:
translate:
name: translate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install localization package
run: npm install -g i18n-auto-translation
- name: Translate files
id: translate
uses: msnyder-msft/[email protected]
with:
provider: 'google-official'
subscriptionKey: '${{ secrets.TRANSLATOR_SUBSCRIPTION_KEY }}'
filePath: './src/localize/languages/en.json'
from: 'en'
to: 'da,de,es,fr,hu,it,nb,nl,pl,pt,ru,sk,zh'
debug: false
- name: Copy new strings to sub-locales
uses: ./.github/actions/copy-to-sub-locales
with:
mappings: pt=>pt-BR,nb=>nn-NO
- name: Get current branch name
id: branch_name
run: echo ::set-output name=current_branch::${GITHUB_REF#refs/*/}
- name: Commit changes
uses: devops-infra/[email protected]
continue-on-error: true
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
commit_prefix: '[Auto] '
commit_message: 'Adding updated localization files'
force: false
target_branch: ${{steps.vars.branch_name.current_branch}}