A plugin to add relative links to Google Translate queries
Project description
mkdocs-google-translate
A mkdocs plugin to add relative paths to Google Translate queries
Install using pip install mkdocs-google-translate
Usage
Activate the plugin in mkdocs.yml by adding the following lines, replace the values of _x_tr_sl and _x_tr_tl to match your site:
extra:
alternate:
# Original Language
- name: English
lang: 'en'
link: '%GT_RELATIVE_URL%' # For relative urls back to original language
# Extra languages
- name: Norsk
lang: 'no'
link: 'https://translate.goog/?_x_tr_sl=en&_x_tr_tl=no'
# _x_tr_sl = source language
# _x_tr_tl = translation language
plugins:
- search
- google-translate:
url: example.com # optional (required for local testing)
Note: If you have no
pluginsentry in your config file yet, you'll likely also want to add thesearchplugin. MkDocs enables it by default if there is nopluginsentry set, but now you have to enable it explicitly.
Incompatabilities
This plugin is somewhat incompatible with the mkdocs feature navigation.instant, due to the fact that the page heading never changes with the feature enabled.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_google_translate-1.3.1.tar.gz.
File metadata
- Download URL: mkdocs_google_translate-1.3.1.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
188e935d94154547e4eabc08096f75ae13788d9ea8bbd0940ba9156a935f7c52
|
|
| MD5 |
35fe5a9fea31b128854781d3d53a61ca
|
|
| BLAKE2b-256 |
3727db9b2dfb7e83c01482275b0bc4ea18a3b1fe228baac3c5ae36331f4b0995
|
File details
Details for the file mkdocs_google_translate-1.3.1-py3-none-any.whl.
File metadata
- Download URL: mkdocs_google_translate-1.3.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92cfb823513afec6401f21014e5b3a248343335d53173d59abf6ea8f0ea54f86
|
|
| MD5 |
d57fefed4a0499f203082f7b52c9ca26
|
|
| BLAKE2b-256 |
d5a61dd2c5372297aa4dc0fa874d9951358a15e798fc03352302592d8cfb44a2
|