Skip to main content

PyBabel json gettext strings extractor

Project description

Release notes

  • 0.2.0 - Added Python 3 support.
  • 0.1.0 - Initial release.


pip install pybabel-json


Add [json: path/**.json] to babel.cfg


  • Uses javascript lexer built in into babel, so no dependencies but babel itself

Key features:

  • Two JSON formats supported: plain string and custom gettext_string format
  • Keys are usually ignored, the only exception are objects with “type”:”gettext_string”
  • Keys are mainly used for logical separation of lists of values that should be translated
  • Lists also supported, both in plain strings and gettext_string format
                "key1":"Some key to translate",
                "key2":"Another key to translate",
                "key3":"Repeating key to translate",
                "key4":"Repeating key to translate"
        "content":"Singular string",
        "alt_content":"Plural string"
        "content":"Another singular string",
        "alt_content":"Another plural string"
            "type" : "gettext_string",
            "funcname" : "ngettext",
            "content" : "list_string 1",
            "alt_content" : "plural list_string1"
            "type" : "gettext_string",
            "funcname" : "ngettext",
            "content" : "list_string 2",
            "alt_content" : "plural list_string2"

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PyBabel-json, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size PyBabel-json-0.2.0.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page