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

Uploaded Source

Built Distribution

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

markdown_gettext-0.2.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file markdown_gettext-0.2.2.tar.gz.

File metadata

  • Download URL: markdown_gettext-0.2.2.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.8 Darwin/25.1.0

File hashes

Hashes for markdown_gettext-0.2.2.tar.gz
Algorithm Hash digest
SHA256 558b4c9b863e373eeb9872b64e2cd7ab40db57a0d8b9c9e93f46412bb2e601dd
MD5 77da4d269a1a43b1825fecb17317756e
BLAKE2b-256 a5a121dd7fd711f5ea285a627c21a1c2d353652a843537b1080b207a22d3d139

See more details on using hashes here.

File details

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

File metadata

  • Download URL: markdown_gettext-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.11.8 Darwin/25.1.0

File hashes

Hashes for markdown_gettext-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 178d687d600ae48e3fab7ecf3d2dfaf0d26bdef2f15c6f51f7c08be92796fc68
MD5 565409edfc50ff675db59ca258c5230a
BLAKE2b-256 ee5d676d0aa1866f8780d26bde94e96031913ec148f2cac353c2301b959bc95c

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