localecmd documentation

Localecmd is a command-line interpreter like cmd and cmd2, but where command and parameter names can switch into your language.

It uses babel and gettext to translate all relevant strings.

Quickstart

Create virtual development environment and install package.

python3 -m venv testing-localecmd
pip install localecmd

Then in python interpreter

>>> from localecmd import programfunction, start_cli
>>> from localecmd.module import Module

>>> @programfunction()
... def hello_world():
...     print("Hello, world!")
...

>>> functions = Module('functions', [hello_world])

>>> cli = start_cli([functions])
The language of the command line is fallback language
>>> cli.runcmd("help")
... 
This will show a list of all available function, including `hello_world`.

>>> cli.runcmd("hello_world")
Hello, world!

>>> cli.close()