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.

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

mkdocs_mdpo_plugin-0.0.2.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

mkdocs_mdpo_plugin-0.0.2-py3-none-any.whl (11.1 kB view hashes)

Uploaded Python 3

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