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.0.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

marshmallow_i18n_messages-0.1.0-py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 3

Supported by

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