This release is a pre-release and may not be stable for production use.
forge-mvc-i18n
Opt-in Forge pour l'internationalisation. Extrait du core (ADR-027) : le core ne contient que les primitives générales ; la traduction est une brique spécialisée, optionnelle.
Contenu
trans(key, locale=None, translations_dir="translations"): traduit une clé via le catalogue de la locale, avec repli sur la locale de fallback puis sur la clé elle-même.load_catalog(locale, translations_dir): charge et valide un cataloguetranslations/<locale>.json(objet JSON de chaînes), mis en cache.clear_translation_cache(): vide le cache des catalogues.get_default_locale/set_default_locale,get_fallback_locale/set_fallback_locale: pilotent la configuration du noyau (i18n_default_locale,i18n_fallback_locale).- Exceptions :
I18nError,TranslationCatalogError.
Quand le paquet est installé, le renderer Jinja du noyau expose
automatiquement trans() comme fonction globale des templates.
Installation
pip install --pre forge-mvc-i18n
Configuration
Les locales par défaut et de fallback sont des clés du noyau, configurables au démarrage :
import core.forge as forge
forge.configure(i18n_default_locale="fr", i18n_fallback_locale="en")
Exemple
from forge_mvc_i18n import trans
# translations/fr.json -> {"common.save": "Enregistrer"}
trans("common.save") # "Enregistrer"
trans("inconnu") # "inconnu" (repli sur la clé)
Metadata
Release files for forge-mvc-i18n 1.0.0rc9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| forge_mvc_i18n-1.0.0rc9.tar.gz | 21.1 kB | Without provenance | Details for forge_mvc_i18n-1.0.0rc9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| forge_mvc_i18n-1.0.0rc9-py3-none-any.whl | Python 3 | none | any | Details for forge_mvc_i18n-1.0.0rc9-py3-none-any.whl |
Total release size: 36.7 kB
Release files / forge_mvc_i18n-1.0.0rc9.tar.gz
| Download URL | forge_mvc_i18n-1.0.0rc9.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9014ef896782f9aa24ffc39a8975ad4f556f4a040878b064e84c0b5cd2370717
|
|
BLAKE2b-256 checksum How to use checksums |
1338c5b25fa5c14917256e4cf5193a4c0dc379a19ef80a8e45aa5f070eb48a01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / forge_mvc_i18n-1.0.0rc9-py3-none-any.whl
| Download URL | forge_mvc_i18n-1.0.0rc9-py3-none-any.whl |
|---|---|
| Size | 15.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
31431602f4dbf78d90ba8831ac668fdf7fdee4ce7b23a8a78f96b21ecd81025e
|
|
BLAKE2b-256 checksum How to use checksums |
e1244005d0a3515192e20f28ff3a2b0dbd5e987ef93d257f47c39e968b730c8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for forge-mvc-i18n 1.0.0rc9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.