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 __ __(“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
Built Distribution
Hashes for python_gettext_translations-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 806bd248aaf3d1c8c7437db7aba4d36fd35572a84fade41bd8a3805f8f7a280c |
|
MD5 | 38ac4419e56d5ac14adde3493a65643c |
|
BLAKE2b-256 | b5b950a668a5042d437b5bacab0d531cc9a98fa58e87269b4796298604bf2e9f |
Hashes for python_gettext_translations-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fe49fa8c03660d63a76e9bf5c3b049e3fa03d0148bfaa8b1aa65b967dfd7858 |
|
MD5 | 786c37b782195c8f5c2e34f086ec52f1 |
|
BLAKE2b-256 | 067ce8157574622a0995bf850aee781876e258d9f055b9b4eb216e5872a3e9d8 |