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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file markdown-gettext-0.2.0.tar.gz
.
File metadata
- Download URL: markdown-gettext-0.2.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98d42219c5c50cecf9b7195d3227f402a32f3d3161ab9b0da7cd264b75358814 |
|
MD5 | b8ef1dec30b9f125de849837ffe6dc6e |
|
BLAKE2b-256 | 9976435cc2e1529bb3d6d49805230cbe74772f5254f91b0070cd8b0ec009c815 |
File details
Details for the file markdown_gettext-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: markdown_gettext-0.2.0-py3-none-any.whl
- Upload date:
- Size: 24.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b49f0ed00348d6b9bf130162ea6b1c89e0f78cf8b35835508ffeec850dbe5356 |
|
MD5 | 3ce6939a3fa89814d59c5c0e5bed9fff |
|
BLAKE2b-256 | 7cacf6f33601565605290df83136b5d431d240ae68039feeb1b9f6fcc1459bc8 |