Skip to main content

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:

  1. Fork the repository and create a feature branch
  2. Add your language to build.sh script and create an empty messages.po in the marshmallow_i18n_messages/translations/<language>/LC_MESSAGES directory
  3. Run the build.sh script
  4. Translate the messages in the generated .po file
  5. Run the build.sh script again
  6. Commit the changes, push to your fork and create a pull request

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

marshmallow_i18n_messages-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

marshmallow_i18n_messages-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file marshmallow_i18n_messages-0.1.1.tar.gz.

File metadata

File hashes

Hashes for marshmallow_i18n_messages-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0ccac29d5bb5232c4808e5e6e200f47fb23266cf2c7e9e0181fb8b504b5cf24d
MD5 194a191f166e47697967bb2bcdc1111d
BLAKE2b-256 fab04577d7808b8e2509106ec20a0efc1b1aaefaa6aefec5442f34b0857e8333

See more details on using hashes here.

File details

Details for the file marshmallow_i18n_messages-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for marshmallow_i18n_messages-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0fec90834eebd23ad976d8fd7c8255dac7224807ed4ddc8c328827f25a24920
MD5 64a0f8197cea3c6a9f5879f715102333
BLAKE2b-256 a0b5be43d549eca78b8c6e5df04acfd518fcffafe75de9d15735b5a407c894e7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page