-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (52 loc) · 1.98 KB
/
action.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
name: "Auto-Localize"
author: "Franck Trouillez"
description: "Automatically localize your project using a translation API"
branding:
color: "green"
icon: "file-text"
inputs:
source_language:
description: "The source language of the text to translate"
required: true
default: "en"
target_languages:
description: "The target languages to translate the text to. Comma-separated if multiple languages are used"
required: true
source_files_directory:
description: "The directory containing the source files to translate. You can use {language} as a placeholder for the source language"
required: true
target_files_directory:
description: "The directory where the translated files will be saved. You can use {language} as a placeholder for the target language"
required: true
variable_pattern:
description: The pattern to use to identify the variables in the source files. Use a regex group to capture the variable name, like "%{(.*?)}" for instance
required: false
default: "%{(.*?)}"
api_keys:
description: "The API keys for the API. Comma-separated if multiple keys are used"
required: true
file_type:
description: "The file type of the source files"
required: true
default: "yaml"
api_type:
description: "The type of the translation API"
required: true
default: "deepl"
prune_useless_keys:
description: "Whether to prune keys that are not present in the source language"
required: false
default: "true"
runs:
using: 'docker'
image: 'Dockerfile'
env:
SOURCE_LANGUAGE: ${{ inputs.source_language }}
TARGET_LANGUAGES: ${{ inputs.target_languages }}
SOURCE_FILES_DIRECTORY: ${{ inputs.source_files_directory }}
TARGET_FILES_DIRECTORY: ${{ inputs.target_files_directory }}
VARIABLE_PATTERN: ${{ inputs.variable_pattern }}
API_KEYS: ${{ inputs.api_keys }}
FILE_TYPE: ${{ inputs.file_type }}
API_TYPE: ${{ inputs.api_type }}
PRUNE_USELESS_KEYS: ${{ inputs.prune_useless_keys }}