-
Notifications
You must be signed in to change notification settings - Fork 7
148 lines (136 loc) · 5.21 KB
/
Copy pathcrowdin.yml
File metadata and controls
148 lines (136 loc) · 5.21 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: 🌐 Crowdin Translations
on:
push:
branches: [ dev, translations ]
paths:
- 'groovy/assets/**/lang/en_us.lang'
workflow_dispatch:
inputs:
operation:
description: 'Operation type'
required: true
default: 'both'
type: choice
options:
- upload
- download
- both
- init
force_upload:
description: 'Force upload all sources (for initialization)'
required: false
default: false
type: boolean
skip_pr:
description: 'Skip pull request creation'
required: false
default: false
type: boolean
download_language:
description: 'Download specific language only (optional)'
required: false
type: string
export_approved_only:
description: 'Export only approved translations'
required: false
default: false
type: boolean
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
jobs:
crowdin-init:
runs-on: ubuntu-latest
if: github.event.inputs.operation == 'init' && github.event.inputs.force_upload == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Initialize Crowdin Project
uses: crowdin/github-action@v2
with:
upload_sources: true
upload_translations: true
configuration: crowdin.yml
upload_sources_args: '--auto-update --preserve-hierarchy'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
- name: Download All Translations
uses: crowdin/github-action@v2
with:
upload_sources: false
upload_translations: false
download_translations: true
configuration: crowdin.yml
localization_branch_name: translations
create_pull_request: ${{ github.event.inputs.skip_pr != 'true' }}
pull_request_base_branch_name: 'dev'
pull_request_title: "Initial Crowdin translations setup"
pull_request_body: "Initial setup of translations from Crowdin"
pull_request_labels: "Pull request: Translation,setup"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_ID }}
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
# crowdin-sync:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v6
# with:
# fetch-depth: 0
# - name: Crowdin Upload Sources
# if: github.event.inputs.operation == 'upload' || github.event.inputs.operation == 'both' || github.event.inputs.operation == 'init' || github.event_name == 'push' || github.event_name == 'schedule'
# uses: crowdin/github-action@v2
# with:
# upload_sources: true
# upload_translations: false
# configuration: crowdin.yml
# # Force upload for initialization
# upload_sources_args: ${{ github.event.inputs.force_upload == 'true' && '--auto-update' || '' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_ID }}
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
# - name: Crowdin Download Translations
# uses: crowdin/github-action@v2
# with:
# upload_sources: false
# upload_translations: true
# download_translations: true
# configuration: crowdin.yml
# localization_branch_name: translations
# create_pull_request: ${{ github.event.inputs.skip_pr != 'true' }}
# pull_request_base_branch_name: 'dev'
# pull_request_title: "New Crowdin updates"
# pull_request_body: "Automated translation updates from Crowdin"
# pull_request_labels: "Pull request: Translation"
# # Optional parameters
# download_language: ${{ github.event.inputs.download_language || '' }}
# export_only_approved: ${{ github.event.inputs.export_approved_only }}
# skip_untranslated_strings: false
# skip_untranslated_files: false
# download_translations_args: ${{ github.event.inputs.export_approved_only == 'true' && '--export-approved-only' || '' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_ID }}
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}
# crowdin-status:
# runs-on: ubuntu-latest
# if: github.event.inputs.operation == 'status'
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Get Crowdin Project Status
# uses: crowdin/github-action@v2
# with:
# command: 'status'
# command_args: '--language ${{ github.event.inputs.download_language || '' }}'
# configuration: crowdin.yml
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CROWDIN_PROJECT_ID: ${{ vars.CROWDIN_ID }}
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_TOKEN }}