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: hard line breaks are replaced with <br />, newlines and consecutive spaces are not kept;
  • Content of each HTML block isn't parsed into finer tokens but processed as a whole;

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.2.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

markdown_gettext-0.2.1-py3-none-any.whl (24.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: markdown-gettext-0.2.1.tar.gz
  • Upload date:
  • Size: 5.4 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.2.1.tar.gz
Algorithm Hash digest
SHA256 0e02f19410fe0fa9889136983f2b41a9dd559d5599e077c5a929ecca679f8f8d
MD5 354d379bce086ab4b74f5ecfdfc90afe
BLAKE2b-256 6fa568431d411a38512dea7d9bb192d4e6eabc8decfd05c0f537cdd61095f028

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for markdown_gettext-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 63a2f5eceb1397396c0ee5fd82aff67763c5e425561921d612bc2f41d8f3fd52
MD5 75508d02f87df403327b3afcce2e76c0
BLAKE2b-256 4851a2450dcf56887d2aaea3b64ef30a593bd2ec2f47fe20fa0ed71b9a1e6814

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