Skip to main content

Python gettext translations

Project description

1. Place your translation files in the directory tree structured as below: .. code-block:: console

i18n/en_GB/messages.po i18n/fr_FR/messages.po

2. Load the translation strings: .. code-block:: python

from translations import init_translations dir_path = os.path.dirname(os.path.realpath(__file__)) init_translations(dir_path + “/i18n”)

3. Get translation string: .. code-block:: python

from translations import translate translate(“de_DE”, “Hello, %user%”, {“user”: “Alexey”}) # Prints “Hello, Alexey”

New version release

To release new version: 1. Update sphinx_integral_theme/__init__.py with new __version__ and __version_info__ 2. Run the following command: .. code-block:: console

(.venv) $ flit publish

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_gettext_translations-1.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

python_gettext_translations-1.1.0-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file python_gettext_translations-1.1.0.tar.gz.

File metadata

File hashes

Hashes for python_gettext_translations-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d54ba5a380e916411e454254f59e232e42e63a43f88c5b6329e196a185dd08fb
MD5 0c8bae946ea7855ba3c1df6e8dd9bd39
BLAKE2b-256 01c03e881d7b44282a8db0d191e2c6dd08ca8370a381dd763e507e3cd5907066

See more details on using hashes here.

File details

Details for the file python_gettext_translations-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_gettext_translations-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2533ffac05bd13143a7a9d3352fc93ce1b46b949ed95a5e74e4d579208cf4185
MD5 fbab6436f425ffac3b98c6f62886d5a7
BLAKE2b-256 ab46142f18b38cbde7c66c53993064bd3b6b3c0e759fe5ffabdc92602f5c6af3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page