-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yml
More file actions
84 lines (68 loc) · 2.13 KB
/
Taskfile.yml
File metadata and controls
84 lines (68 loc) · 2.13 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
# Taskfile to be used with task: https://taskfile.dev
#
# A copy of task gets automatically installed as a "develop" dependency this plugin:
#
# pip install .[develop]
# go-task --list-all
#
version: "3"
env:
LOCALES: ["de"] # list your included locales here, e.g. ["de", "fr"]
TRANSLATIONS: "octoprint_mfa_totp/translations" # translations folder
tasks:
install:
desc: Installs the plugin into the current venv
cmds:
- "python -m pip install -e .[develop]"
### Build related
build:
desc: Builds sdist & wheel
cmds:
- python -m build --sdist --wheel
build-sdist:
desc: Builds sdist
cmds:
- python -m build --sdist
build-wheel:
desc: Builds wheel
cmds:
- python -m build --wheel
### Translation related
babel-new:
desc: Create a new translation for a locale
cmds:
- task: babel-extract
- pybabel init --input-file=translations/messages.pot --output-dir=translations --locale="{{ .CLI_ARGS }}"
babel-extract:
desc: Update pot file from source
cmds:
- pybabel extract --mapping-file=babel.cfg --output-file=translations/messages.pot --msgid-bugs-address=i18n@octoprint.org --copyright-holder="The OctoPrint Project" .
babel-update:
desc: Update translation files from pot file
cmds:
- for:
var: LOCALES
cmd: pybabel update --input-file=translations/messages.pot --output-dir=translations --locale={{ .ITEM }}
babel-refresh:
desc: Update translation files from source
cmds:
- task: babel-extract
- task: babel-update
babel-compile:
desc: Compile translation files
cmds:
- pybabel compile --directory=translations
babel-bundle:
desc: Bundle translations
preconditions:
- test -d {{ .TRANSLATIONS }}
cmds:
- for:
var: LOCALES
cmd: |
locale="{{ .ITEM }}"
source="translations/${locale}"
target="{{ .TRANSLATIONS }}/${locale}"
[ ! -d "${target}" ] || rm -r "${target}"
echo "Copying translations for locale ${locale} from ${source} to ${target}..."
cp -r "${source}" "${target}"