Skip to main content

MkDocs static i18n plugin

An MkDoc plugin that helps you support multiple language versions of your site / documentation.

The mkdocs-static-i18n plugin allows you to support multiple languages of your documentation by adding static translation files to your existing documentation pages.

Multi language support is just one .<language>.md file away!

If you want to see how it looks, check out the demo documentation here.

Language detection logic

This plugin is made to be as simple as possible and will generate a default version of your website + one per configured language on the <language>/ path.

  • the default version will use any .md documentation file first and fallback to any .<default_language>.md file found
  • the /<language> language versions will use any .<language>.md documentation file first and fallback to any .<default_language>.md file before fallbacking to any default .md file found

Since demonstrations are better than words, check out the demo documentation here which showcases the logic.

Installation

Just pip install mkdocs-static-i18n!

Configuration

All the parameters are mandatory:

  • default_language: string
  • languages: mapping of language name: display value
plugins:
  - i18n:
      default_language: en
      languages:
        en: english
        fr: français

Example output

Using the configuration above on the following docs/ structure will build the following site/ (leaving out static files for readability):

docs
├── index.fr.md
├── index.md
├── topic1
│   ├── index.en.md
│   └── index.fr.md
└── topic2
    ├── index.en.md
    └── index.md
site
├── en
│   ├── index.html
│   ├── topic1
│   │   └── index.html
│   └── topic2
│       └── index.html
├── fr
│   ├── index.html
│   ├── topic1
│   │   └── index.html
│   └── topic2
│       └── index.html
├── index.html
├── topic1
│   └── index.html
└── topic2
    └── index.html

Compatibility with other plugins

This plugin is compatible with the following mkdocs plugins:

  • MkDocs Material: the search plugin text will be switched automatically to the right language depending on the version you're browsing
  • MkDocs Awesome Pages Plugin: the page ordering is preserved on the language specific versions of your site

TODO

Contributions welcome!

Feel free to ask questions, enhancements and to contribute to this project!

Download files

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

Source Distribution

mkdocs-static-i18n-0.2.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file mkdocs-static-i18n-0.2.tar.gz.

File metadata

  • Download URL: mkdocs-static-i18n-0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7

File hashes

Hashes for mkdocs-static-i18n-0.2.tar.gz
Algorithm Hash digest
SHA256 4b0b8f0191ab30e0d092d623e3ca712095fef3c87884b9c538ec69571fbe7502
MD5 f09be7531e70f07b346591f518862404
BLAKE2b-256 74fb9e1fa157f46c7c5dd1e36f2d0c1edbd36e3266744dee2241ca668b97d1d1

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.1

2 files

1.3.0

2 files

1.2.3

2 files

1.2.2

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.56

1 file

0.55

1 file

0.54

1 file

0.53

1 file

0.52

1 file

0.51

1 file

0.50

1 file

0.49

1 file

0.48

1 file

0.47

1 file

0.46

1 file

0.45

1 file

0.44

1 file

0.43

1 file

0.42

1 file

0.41

1 file

0.40

1 file

0.31

1 file

0.30

1 file

0.22

1 file

0.21

1 file

0.20

1 file

0.19

1 file

0.18

1 file

0.17

1 file

0.16

1 file

0.15

1 file

0.14

1 file

0.13

1 file

0.12

1 file

0.11

1 file

0.10

1 file

0.8

1 file

0.7

1 file

0.6

1 file

0.5

1 file

0.4

1 file

0.3

1 file

This release

0.2 This release

1 file

0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page