Hetman Pipeline Plugin I18n is a plugin for Hetman Pipeline that provides i18n support.
Project description
Hetman Pipeline Plugin I18n is a plugin for Hetman Pipeline that provides internationalization (i18n) support.
Features
- Comprehensive translations for all standard
ConditionandMatchhandlers. - Simple initialization to register all translations globally.
Installation
pip install hetman-pipeline[i18n]
Quick Start
Initialize the plugin at the start of your application to register the translations.
from pipeline_plugin_i18n import initialize_pipeline_plugin_i18n
# Register translations for standard handlers
initialize_pipeline_plugin_i18n()
Context Management
The plugin uses contextvars to manage the locale state, making it thread-safe and safe for asynchronous applications (e.g., FastAPI, Falcon, Flask).
Setting the Locale
You can set the locale for the current context (e.g., per request).
from pipeline_plugin_i18n import PipelinePluginI18n
# Set to Polish
PipelinePluginI18n.set_locale("pl")
Getting the Locale
from pipeline_plugin_i18n import PipelinePluginI18n
current_locale = PipelinePluginI18n.get_locale()
print(current_locale) # Output: "pl"
Custom Translations
You can register your own translations for any Condition or Match handler.
from pipeline.handlers import Match
from pipeline.handlers.base_handler.resources.constants import HandlerMode
from pipeline_plugin_i18n import PipelinePluginI18n
PipelinePluginI18n.register_handler(
handler=Match.Text.Letters,
translations={
HandlerMode.ROOT: {
"en": Match.Text.Letters.ERROR_TEMPLATES[HandlerMode.ROOT],
"pl": "Musi zawierać tylko litery (np. Aaaaa).",
}
},
)
Supported Languages
- English (
en) - Default - Polish (
pl)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hetman_pipeline_plugin_i18n-1.0.2.tar.gz.
File metadata
- Download URL: hetman_pipeline_plugin_i18n-1.0.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2cd621b0d3e7281cb45ee8a49ffd06dbeb16262e41bc9af8a679ab808ffc459d
|
|
| MD5 |
a69bb0786459e64f03ba25c564bc1051
|
|
| BLAKE2b-256 |
82ccbd01cf7f464281daba9d8e205f7cb6f40d8e0699df913c1b5ee0f8d0718d
|
Provenance
The following attestation bundles were made for hetman_pipeline_plugin_i18n-1.0.2.tar.gz:
Publisher:
python-publish.yml on hetman-app/hetman-pipeline-plugin-i18n
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hetman_pipeline_plugin_i18n-1.0.2.tar.gz -
Subject digest:
2cd621b0d3e7281cb45ee8a49ffd06dbeb16262e41bc9af8a679ab808ffc459d - Sigstore transparency entry: 815089651
- Sigstore integration time:
-
Permalink:
hetman-app/hetman-pipeline-plugin-i18n@727bd93c2065aa51ea87863b096fede47e5ebc72 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/hetman-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@727bd93c2065aa51ea87863b096fede47e5ebc72 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hetman_pipeline_plugin_i18n-1.0.2-py3-none-any.whl.
File metadata
- Download URL: hetman_pipeline_plugin_i18n-1.0.2-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac7eefa8e0aa28b6b62e2629e42290e7c216d88896299bdc5161719257bfc9cc
|
|
| MD5 |
e11480846df8e6ece6ff4c00ce8bcbc6
|
|
| BLAKE2b-256 |
f4e6567992cc34245c5e735fa8e00ae40cdf8af5561803d01dd8c2f92791eb3c
|
Provenance
The following attestation bundles were made for hetman_pipeline_plugin_i18n-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on hetman-app/hetman-pipeline-plugin-i18n
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hetman_pipeline_plugin_i18n-1.0.2-py3-none-any.whl -
Subject digest:
ac7eefa8e0aa28b6b62e2629e42290e7c216d88896299bdc5161719257bfc9cc - Sigstore transparency entry: 815089658
- Sigstore integration time:
-
Permalink:
hetman-app/hetman-pipeline-plugin-i18n@727bd93c2065aa51ea87863b096fede47e5ebc72 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/hetman-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@727bd93c2065aa51ea87863b096fede47e5ebc72 -
Trigger Event:
release
-
Statement type: