Skip to main content

Mkdocs plugin for translations using PO files.

Project description

mkdocs-mdpo-plugin

PyPI version Downloads Test Documentation Cloudflare DNS

Translations for Mkdocs using PO files, fully customizable. Compatible with mkdocs-material, based on mdpo.

Documentation: en - es

Install

pip install mkdocs-mdpo-plugin

Usage

Enable the plugin in your mkdocs.yml:

plugins:
  - mdpo

Minimal configuration

With mkdocs-material

theme:
  name: material
  language: en

extra:
  alternate:
    - name: English
      lang: en
    - name: Español
      link: es
      lang: es

plugins:
  - mdpo

Standalone

plugins:
  - mdpo:
      languages:
        - en     # first language is the original
        - es

Both previous configurations will create the same layout of files building the documentation. Given the next layout in a docs/ directory:

📁 docs
└── 📄 index.md

After the build, you will get:

📁 docs
├── 📁 es
│   └── 📄 index.md.po
└── 📄 index.md

Just translate the strings in docs/es/index.md.po into Spanish, build again with mkdocs build and the site/ directory will look like:

📁 site
├── 📄 404.html
├── 📁 assets
│   ├── 📁 images
│   ├── 📁 javascripts
│   └── 📁 stylesheets
├── 📁 es
│   └── 📄 index.html
├── 📄 index.html
├── 📄 sitemap.xml
└── 📄 sitemap.xml.gz

Simple and easy. The extraction of messages process and the produced layout are fully customizable, you can even translate code blocks! Check the full documentation here.

Download files

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

Source Distribution

mkdocs_mdpo_plugin-0.0.27.linux-x86_64.tar.gz (40.0 kB view details)

Uploaded Source

Built Distribution

mkdocs_mdpo_plugin-0.0.27-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_mdpo_plugin-0.0.27.linux-x86_64.tar.gz.

File metadata

File hashes

Hashes for mkdocs_mdpo_plugin-0.0.27.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 7781fdb9118d0edf827e1b5ad843ed5922cc380c4d36a3075a4bc673c492f728
MD5 83cecb27c412a148314e517836d68bbd
BLAKE2b-256 85d3f03b3bd0e3a4c1b8163731c525c41b342ed6fc891adf5d843f3de61e53fc

See more details on using hashes here.

File details

Details for the file mkdocs_mdpo_plugin-0.0.27-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_mdpo_plugin-0.0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 2faa1cc0f2b2c62b7b4b812334888e44c2a534fde525fc41e9f6914a722ed2fc
MD5 19fa83ed01dfb78cb8b48dcae9ead89c
BLAKE2b-256 b1c8c4fc3d318e404755b0800d09a043b68db179e671e7018f49f236787bf6b0

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