Mkdocs plugin for translations using PO files.
Project description
mkdocs-mdpo-plugin
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.
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 mkdocs_mdpo_plugin-0.0.27.linux-x86_64.tar.gz
.
File metadata
- Download URL: mkdocs_mdpo_plugin-0.0.27.linux-x86_64.tar.gz
- Upload date:
- Size: 40.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7781fdb9118d0edf827e1b5ad843ed5922cc380c4d36a3075a4bc673c492f728 |
|
MD5 | 83cecb27c412a148314e517836d68bbd |
|
BLAKE2b-256 | 85d3f03b3bd0e3a4c1b8163731c525c41b342ed6fc891adf5d843f3de61e53fc |
File details
Details for the file mkdocs_mdpo_plugin-0.0.27-py3-none-any.whl
.
File metadata
- Download URL: mkdocs_mdpo_plugin-0.0.27-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2faa1cc0f2b2c62b7b4b812334888e44c2a534fde525fc41e9f6914a722ed2fc |
|
MD5 | 19fa83ed01dfb78cb8b48dcae9ead89c |
|
BLAKE2b-256 | b1c8c4fc3d318e404755b0800d09a043b68db179e671e7018f49f236787bf6b0 |