-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbase.config.yaml
365 lines (284 loc) · 13.9 KB
/
base.config.yaml
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
---
#
# -------------------------------------------------------------
# ----------------- CROWDIN SETTINGS SECTION ------------------
# -------------------------------------------------------------
#
# Set defaults for Crowdin API integration for all of your projects.
# E.g., if all projects are hosted on your enterprise accounts,
# set `organization` here and you can omit it in crowdin.config.yaml.
#
# crowdin.config.yaml contains the exact same section.
# Any key present in crowdin.yaml overwrites these values.
# For security reasons, api-token can only be set in crowdin.config.yaml.
# Never publish or share your API token or crowdin.config.yaml!
#
crowdin:
organization: ''
# Set to your organization name if the project is on enterprise account.
# Leave this empty, if the project is on crowdin.com.
# token: API TOKEN YOU GENERATE ON CROWDIN
# You can't set it here, you can only set it in crowdin.config.yaml,
# which you should keep secret.
#
# -----------------------------------------------------------
# ---------- NEVER SHARE YOUR API TOKEN ANYWHERE! -----------
# -----------------------------------------------------------
project_id: 123456
# Project ID on Crowdin.
#
# -------------------------------------------------------------
# ----------------- LOCSYNC SETTINGS SECTION ------------------
# -------------------------------------------------------------
#
parameters:
stop-on-errors: True
# Should we stop if one task crashes or returns an error?
use-unreal: True
# Should we launch scripts that require unreal.py?
# Requires Unreal Python plugin to be enabled
# Launches scripts via unreal-cmd.exe to leverage the unreal.py
p4-checkout: False
# Should we check out files from p4?
# By default, it checks out the whole Localization folder.
# You can also specify additional files for checkout in script settings below.
# UE editor P4 settings are used (Saved/Config/Windows/SourceControlSettings.ini)
p4-checkin: False # TODO: implement this
# Should we check in the files back to p4?
p4-cl-desc: | # TODO: check out the files into a separate CL with this description
* Imported latest translations from Crowdin
* Updated language completion rates in the language selection menu
* Updated community translators in credits
* Updated the source file on Crowdin
# Default CL descripiton to use for check-outs and check-ins
# -------------------------------------------------------------
# ----- SCRIPT PARAMETERS: SET DEFAULTS FOR SCRIPTS HERE ------
# -------------------------------------------------------------
script-parameters:
# Add source files from several loc targets to Crowdin,
# with specified type and proper export pattern
# (to simplify built translations processing)
add-source-files:
loc_targets: ['Game']
file_format: 'auto' # ...or 'gettext-unreal' (when the full support is there)
src_locale: io
# It's a good idea to use the debug ID locale for this
# because it's sorted, features debug IDs, automated comments,
# repetition markers, and asset names in context
# (see test-lang script settings below)
export_pattern: '{target}/%locale%/{target}.po'
# Script will substitute the {target} key,
# %keys% are part of Crowdin export settings,
# see https://support.crowdin.com/files-management/#file-export
# Also see how to add custom locale codes to match those in Unreal:
# https://support.crowdin.com/advanced-project-setup/#adding-custom-language-codes
content_dir: '../'
# Create source locale (sorted, with debug IDs in context, with comments),
# which also serves as debug ID locale (simple unique debug IDs for all strings).
# And creating a Hash locale (basic pseudo-localization) if needed.
test-lang:
loc_targets: ['Game']
hash_locale: ia-001 # Set to '' (empty) to disable hash locale generation
hash_prefix: '# '
hash_suffix: ' ~'
debug_ID_locale: io # Set to '' (empty) to disable debug ID locale generation
clear_translations: No
id_length: 4 # Start over (clear_translations = True) if you change id length
encoding: utf-8-sig
sort_po: Yes
var_regex: '{[^}\[<]+}|<[^/>]+/>' # Looking for {variables} and <empty tags ... />
comments_criteria:
# Ths will add comments based on criteria (e.g., to explain a feature or syntax)
# Format is as follows:
# - - 'field' = PO entry field to search (msgctxt, msgid, msgstr, comment)
# - 'RegEx' = regex to use for checking
# - |-
# "Multiline comment that requires explicit \n for new lines"
# "This comment will be added if `RegEx` is found in the PO entry `field`"
- - 'msgid' # Hint for lines with Unreal inline plurals
- '}\|plural\('
- |-
"Please adapt to your language plural rules. We only support keywords: "
"zero, one, two, few, many, other.\n"
"Use Alt + C on Crowdin to create a skeleton adapted to your language grammar.\n"
"Translate only white text in curly braces. Test using the form "
"below the Preview box.\n"
"Check what keywords stand for here: "
"http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html."
- - 'msgctxt' # Example: Hint for abbreviated items, matched by namespace
- 'AbbreviatedDisplayName,'
- |-
"Abbreviation slot fits 10 i's: iiiiIiiiiI. E.g.,:\n"
"iiiiIiiiiI\nSilica (fits)\nСталь (doesn't fit)"
- - 'msgid' # Example: Hint for lines with 'Zoop' in source (Satisfactory)
- '\b[Zz]oop'
- |-
"Please keep this one as is or transliterate/change spelling only. "
"Don't come up with funny names: it brings more harm than good."
content_dir: '../'
# Build the translation project on Crowdin, download it, unpack,
# move to the Unreal Localization directory to make it ready for import.
# Warning: This will overwrite any existing POs in Unreal Localization directory.
build-and-download:
loc_targets: ['Game'] # Localization targets, empty = process all targets
# Relative to Content directory
zip_name: 'Localization/~Temp/LocFilesTemp.zip'
temp_dir: 'Localization/~Temp/LocFilesTemp'
dest_dir: 'Localization/{target}/'
locales_to_delete: ['en-US-POSIX']
content_dir: '../'
# Get top members from Crowdin and update the community credits CSV file,
# making it ready to be reimported into the data table asset in Unreal
community-credits:
csv_name: 'FactoryGame/Interface/UI/DT_Credits_Community.csv'
# Relative to Content directory
csv_encoding: 'utf-16-le'
translation_threshold: 2000
review_threshold: 2000
users_to_exclude: [ ] # ['logins', 'you', 'want', 'to', 'exclude']
content_dir: '../'
# Get completion rates from Crowdin and update the language list CSV file,
# ready to be reimported into the data table asset in Unreal
completion-rates:
loc_targets: ['Game'] # Localization targets, empty = process all targets
cultures_to_skip: ['en-US-POSIX', 'io']
# Locales to skip (native, debug, hash, etc.)
# Relative to Content directory
csv_name: 'Localization/DT_OptionsMenuLanguages.csv'
csv_encoding: 'utf-16-le'
content_dir: '../'
# Check out Localization directory and any other assets from p4 server
p4-checkout:
loc_targets: ['Game'] # Localization targets, empty = process all targets
add_assets_to_checkout: [
'FactoryGame/Interface/UI/DT_Credits_Community.csv',
'FactoryGame/Interface/UI/DT_Credits_Community.uasset',
]
config_name: '../Saved/Config/Windows/SourceControlSettings.ini'
p4_config_section: 'PerforceSourceControl.PerforceSourceControlSettings'
content_dir: '../'
# Warning: For now this script only supports one config here, not in task lists.
# Warning: The ue-reimport-assets section is very sensitive to formatting
# because it's parsed without the yaml module.
# Add one asset per line like this (Copy Reference in UE):
# "AssetType'/Game/GameName/Path/To/Asset/Asset_Name.Asset_Name'",
# don't add any comments and don't change any other lines in this section.
ue-reimport-assets: # Don't change this line
assets_to_reimport: [ # Don't change this line, add assets one per line below
"DataTable'/Game/FactoryGame/Interface/UI/DT_Credits_Community.DT_Credits_Community'",
"DataTable'/Game/Localization/DT_OptionsMenuLanguages.DT_OptionsMenuLanguages'"
] # Don't change this line
# Run the Unreal gather text commandlet for any number of loc targets
# with any number of ini files as parameters
# Set the defaults here, and specify ini files (steps) in task lists
ue-loc-gather-cmd:
loc_targets: ['Game'] # Localization targets, empty = process all targets
# Relative to Game/Content directory
tasks_to_perform: [ ]
# Steps to perform. Config/Localization .ini file suffixes:
# Gather, Export, Import, Сompile, GenerateReports, etc.
# Specify this in task lists to run specific tasks.
# E.g., [Gather, Export] or [Import, Compile, GenerateReports]
try_patch_dependencies: Yes
# Should we patch dependencies in *_Gather.ini files?
# This seems to be needed if the project and engine
# are in completely separate directories
content_dir: '../'
# project_dir: '' # Will try to find it if empty
# engine_dir: '' # Will try to find it if empty
# Update source files for several loc targets on Crowdin
update-source-files:
loc_targets: ['Game'] # Localization targets, empty = process all targets
src_locale: io
# It's a good idea to use the same locale here and in add-source-files
# It's also a good idea to use debug ID locale :)
content_dir: '../'
#
# -------------------------------------------------------------
# ------------------------ TASK LISTS -------------------------
# -------------------------------------------------------------
#
# Task lists are lists of scripts to be executed one after another.
# You can add as many task lists as you like.
# Launch them by running 'locsync.py scenario_name'
# A list of tasks, each task is a few of key-value pairs like this:
# description: required, this will be printed as the task is performed,
# and in the summary
# script: 'script_filename.py', required, relative path to the script file
# unreal: optional, True/False,
# flags if this script has to be launched via unreal-cmd.exe
# p4-checkout/p4-checkin: optional, True/False,
# flags if the script is checks out assets or checks them in
# script-parameters: can contain any script specific parameters
# that will override the defaults above
# All scripts use this config and crowdin.config.yaml for configuration.
no-source-upload:
# Enable p4-checkout to let this work or check out Localization folder
# and other assets manually
# - description: 'Checkout Localization folder and community credits files'
# script: p4-checkout.py
# p4-checkout: True
- description: 'Gather the text in UE for all targets and export all locales'
script: ue-loc-gather-commandlet.py
script-parameters:
tasks: [Gather, Export]
- description: 'Generate hash and test/source locale with comments and debug IDs'
script: test-lang.py
# script-parameters:
# hash_locale: '' # Disable hash locale generation
# - description: 'Pull language completion rates from Crowdin, save them to a CSV file'
# script: compl_rate.py
# - description: 'Pull top members from Crowdin, save the data to a CSV file'
# script: community_credits.py
# - description: 'Reimport language list and community credits datatables from CSVs'
# script: ue-reimport-assets.py
# unreal: True
# - description: 'Upload the updated source file to Crowdin'
# script: upload_source.py
- description: 'Build the project on Crowdin and download all targets to Content/Localization'
script: build-and-download.py
- description: 'Import and compile all targets in UE'
script: ue-loc-gather-commandlet.py
script-parameters:
tasks: [Import, Compile, GenerateReports]
# end of default
upload-source:
# Upload new source file from test/io locale to Crowdin
- description: 'Upload the updated source file to Crowdin'
script: upload_source.py
# end of upload-source
full-sync:
# - description: 'Checkout Localization folder and community credits files'
# # Enable p4-checkout to let this work or check out Localization folder and other assets manually
# script: p4-checkout.py
# p4-checkout: True
- description: 'Gather the text in UE for all targets and export the source/test locale draft'
script: ue-loc-gather-commandlet.py
script-parameters:
tasks: [Gather, Export]
- description: 'Generate test from draft and source locale with comments and debug IDs'
script: test-lang.py
# - description: 'Pull language completion rates from Crowdin and save them to a CSV file'
# script: compl_rate.py
# - description: 'Pull top members from Crowdin, generate date for credits and save it to a CSV file'
# script: community_credits.py
# - description: 'Reimport language list and community credits datatables from CSVs'
# script: ue-reimport-assets.py
# unreal: True
- description: 'Upload the updated source file to Crowdin'
script: upload-source.py
- description: 'Build the project on Crowdin and download all targets to Content/Localization'
script: build-and-download.py
- description: 'Import and compile all targets in UE'
script: ue-loc-gather-commandlet.py
script-parameters:
tasks: [Import, Compile, GenerateReports]
# end of full-sync
recreate-test-language:
- description: 'Generate hash and test/source locale with comments and debug IDs'
script: test-lang.py
script-parameters:
hash_locale: '' # Disable hash locale generation
clear_translations: Yes
# end of recreate-test-language
...