Skip to content

Internationalization

User-facing strings in the frontend are wrapped in OctoPrint's gettext() so they can be translated, e.g.:

self.infoError(gettext("Stream server not reachable. Is it running?"));

Catalog layout

Translation catalogs live under translations/ (and the compiled copy under octoprint_bambucam/translations/):

translations/
├── messages.pot                       # extraction template
└── de/LC_MESSAGES/messages.po|.mo     # German catalog

babel.cfg configures string extraction from Python and Jinja2 templates.

Common Babel tasks

# extract translatable strings into the .pot template
pybabel extract -F babel.cfg -o translations/messages.pot .

# update existing catalogs from the template
pybabel update -i translations/messages.pot -d translations

# compile .po → .mo
pybabel compile -d translations

CI check

The i18n workflow (.github/workflows/i18n.yml) verifies the catalogs stay in sync on pushes and pull requests, mirroring the local .githooks/check_translations_sync.sh hook.