Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
include README.md
recursive-include octoprint_automaticshutdown/templates *
recursive-include octoprint_automaticshutdown/translations *
recursive-include octoprint_automaticshutdown/static *
87 changes: 87 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

# 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: ['es'] # list your included locales here, e.g. ["de", "fr"]
TRANSLATIONS: "octoprint_automaticshutdown/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}"

Loading