A patch to marshmallow to allow to translate marshmallow messages via GNU gettext
Project description
marshmallow-i18n-messages
A simple library to provide i18n messages for marshmallow validation errors.
Installation
from marshmallow_i18n_messages import add_i18n_to_marshmallow
add_i18n_to_marshmallow()
Usage
After the initialization above, all marshmallow validation errors will be translated to the current babel locale.
Invenio usage
In Invenio, call the statements above on top of the invenio.cfg
file, before any other imports.
Contributing new translations
To contribute new translations/fix translation issues:
- Fork the repository and create a feature branch
- Add your language to build.sh script and create an empty
messages.po
in themarshmallow_i18n_messages/translations/<language>/LC_MESSAGES
directory - Run the build.sh script
- Translate the messages in the generated .po file
- Run the build.sh script again
- Commit the changes, push to your fork and create a pull request
Project details
Release history Release notifications | RSS feed
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
Close
Hashes for marshmallow_i18n_messages-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0d4263e76dfd437c45560dfa486ee49bc11d704caf061b3ab81656bc2b4b29a |
|
MD5 | 070cdc486b209154305fa1bd5901f274 |
|
BLAKE2b-256 | e8a466e5dbbf709937081850b2e70db2e2d662a5d7907d9e625c6b18d69a4cdc |
Close
Hashes for marshmallow_i18n_messages-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2900284a6656114154dc134383f8a5291d5316663ded3e626fc7aa3bf850c8 |
|
MD5 | 9dcc346de22aac846056d4368092dfca |
|
BLAKE2b-256 | c0c9058efcbe032fa65d7c8fd89c77c7399f694591792d141f0149ea485ccca2 |