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.
Release files for mkdocs-google-translate 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mkdocs_google_translate-1.3.1.tar.gz | 4.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mkdocs_google_translate-1.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / mkdocs_google_translate-1.3.1.tar.gz
| Download URL | mkdocs_google_translate-1.3.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
188e935d94154547e4eabc08096f75ae13788d9ea8bbd0940ba9156a935f7c52
|
|
BLAKE2b-256 checksum How to use checksums |
3727db9b2dfb7e83c01482275b0bc4ea18a3b1fe228baac3c5ae36331f4b0995
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / mkdocs_google_translate-1.3.1-py3-none-any.whl
| Download URL | mkdocs_google_translate-1.3.1-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92cfb823513afec6401f21014e5b3a248343335d53173d59abf6ea8f0ea54f86
|
|
BLAKE2b-256 checksum How to use checksums |
d5a61dd2c5372297aa4dc0fa874d9951358a15e798fc03352302592d8cfb44a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|