Skip to main content

Mkdocs plugin for translations using PO files.

Project description

mkdocs-mdpo-plugin

PyPI version Test Documentation Coverage status

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

Check the full documentation here.

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.

Files for mkdocs-mdpo-plugin, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size mkdocs_mdpo_plugin-0.0.3-py3-none-any.whl (10.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mkdocs_mdpo_plugin-0.0.3.tar.gz (11.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page