Skip to main content

Markdown i18n with gettext

Project description

markdown-gettext

A command line program to do i18n and l10n for individual Markdown files.

CommonMark compliant. All core Markdown elements are supported, as well as YAML front matter, table, and definition list.

Install

pip install markdown-gettext

Usage

You can use either md-gettext or markdown-gettext command

Extraction

md-gettext extract [-p PACKAGE] [-r REPORT_ADDR] [-t TEAM_ADDR] md pot

positional arguments:
  md                    path of the Markdown file to extract messages from
  pot                   path of the POT file to create

optional arguments:
  -p PACKAGE, --package PACKAGE
                        the package name in POT metadata
  -r REPORT_ADDR, --report-addr REPORT_ADDR
                        the report address in POT metadata
  -t TEAM_ADDR, --team-addr TEAM_ADDR
                        the team address in POT metadata

Generation

md-gettext generate [-l LANG] in-md po out-md

positional arguments:
  in-md                 path of the source Markdown file
  po                    path of the PO file containing translations
  out-md                path of the Markdown file to create

optional arguments:
  -l LANG, --lang LANG  language of translations

Notes

Some notes about how different elements are handled:

  • Inlines: newlines and consecutive spaces are not kept;
  • Content of each HTML block isn't parsed into finer tokens but processed as a whole;
  • Fenced code blocks: only // single comments are processed;

Development environment

  • With Conda
conda env create -f environment.yml
conda activate mg
poetry install

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

markdown-gettext-0.1.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

markdown_gettext-0.1.4-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file markdown-gettext-0.1.4.tar.gz.

File metadata

  • Download URL: markdown-gettext-0.1.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.5

File hashes

Hashes for markdown-gettext-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6616c81558ec3c859890ad6d5c21e9ed57356db881cc027a065174f5ec6fc155
MD5 45e6d01d7543f48187b95068d772b80b
BLAKE2b-256 2bf0f45397f0f63115b0ccd96e7ebe64007d02d2166d228c4066d5bfd75055fa

See more details on using hashes here.

File details

Details for the file markdown_gettext-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for markdown_gettext-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 243d301ecfea8b660eee0d90392a70aa513feedd872d3259530c22b91d6f2788
MD5 940b1b7967665842cfa9e1e0ef56fc55
BLAKE2b-256 728ad2a4fab0bce2e3fda83e80a1a4ef3bbdf6d2d5cc539818ef17affce174f6

See more details on using hashes here.

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