Usage
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
Metadata
Release files for python-gettext-translations 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python_gettext_translations-1.1.0.tar.gz | 2.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_gettext_translations-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 5.5 kB
Release files / python_gettext_translations-1.1.0.tar.gz
| Download URL | python_gettext_translations-1.1.0.tar.gz |
|---|---|
| Size | 2.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d54ba5a380e916411e454254f59e232e42e63a43f88c5b6329e196a185dd08fb
|
|
BLAKE2b-256 checksum How to use checksums |
01c03e881d7b44282a8db0d191e2c6dd08ca8370a381dd763e507e3cd5907066
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|
Release files / python_gettext_translations-1.1.0-py3-none-any.whl
| Download URL | python_gettext_translations-1.1.0-py3-none-any.whl |
|---|---|
| Size | 2.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2533ffac05bd13143a7a9d3352fc93ce1b46b949ed95a5e74e4d579208cf4185
|
|
BLAKE2b-256 checksum How to use checksums |
ab46142f18b38cbde7c66c53993064bd3b6b3c0e759fe5ffabdc92602f5c6af3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.31.0
|