Repository navigation
API turboframe.i18n_tools
Source: turboframe/i18n_tools.py. Generated from the code of TurboFrame 0.3.0 by tools/wiki_api.py.
An application's catalogues, with Babel (a development tool; the application itself needs only gettext).
python -m turboframe.i18n_tools --domain myapp --src src/myapp extract # src/myapp/locale/myapp.pot
python -m turboframe.i18n_tools --domain myapp --src src/myapp update # merge it into every .po
python -m turboframe.i18n_tools --domain myapp --src src/myapp init es # start a new language
python -m turboframe.i18n_tools --domain myapp --src src/myapp compile # .po -> .mo (shipped)
python -m turboframe.i18n_tools --domain myapp --src src/myapp all # extract, update, compile
python -m turboframe.i18n_tools --domain myapp --src src/myapp check # what is wrong, if anythingThe locale folder is <src>/locale unless --locale says otherwise. The texts are the literal arguments of _(), N_() and ngettext(). Translate the .po files with any gettext editor (Poedit, Weblate...), keeping the ~hotkey~ marks (one letter, unique in its menu or dialog) and the {placeholders}; check (turboframe.testing.i18n) finds what is not.
Babel comes with the i18n extra: pip install "turboframe[i18n] @ git+...".
class Catalogues
Catalogues(domain: str, src: Path, locale: Path | None = None, *, project: str | None = None, bugs: str | None = None)The catalogues of domain: <locale>/<domain>.pot and <locale>/<lang>/LC_MESSAGES/<domain>.po, made from the texts marked in src.
pos() -> list[Path]extract() -> Noneupdate() -> Noneinit(language: str) -> Nonecompile() -> Nonecheck() -> list[str]
def main(argv: list[str] | None = None) -> intTurboFrame · part of Divengine · GPL-3.0-or-later · report an issue
Tutorial
Examples
The desktop
- The Desktop
- Application Mixins
- Windows and Lists
- Dialogs
- Histories
- Progress
- Themes and Colors
- Glyphs
- Settings and Recent Files
- Command Palette
Editing
Tasks
Languages
Running
Reference
Links