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
plugins
entry in your config file yet, you'll likely also want to add thesearch
plugin. MkDocs enables it by default if there is noplugins
entry 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
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
Hashes for mkdocs-google-translate-1.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d8ab7a478942a0d3707fbe9474cac2ae59b3277e1b4834d663ca502b498e883 |
|
MD5 | 653dd0d47b93b7110c9a7cfd84cc39fd |
|
BLAKE2b-256 | e771066c9ba144e80c64dbbc714b17db46e85ecd4f99387c985dc1bee5b7d8be |
Hashes for mkdocs_google_translate-1.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9df67f7b5498aff35fed2cd6bdce5a5ed357af7432557739186edf2829077e5 |
|
MD5 | d2569631c33d372841ace2e6c7ab983a |
|
BLAKE2b-256 | 7f98fbd2a0078650384181248bd68f3402e7d69654f9d45db0ad0f08029aac71 |