# mkdocs-google-translate
[![Build Status](https://img.shields.io/github/actions/workflow/status/sondregronas/mkdocs-google-translate/CI.yml?branch=main)](https://github.com/sondregronas/mkdocs-google-translate/)
[![GitHub latest commit](https://img.shields.io/github/last-commit/sondregronas/mkdocs-google-translate)](https://github.com/sondregronas/mkdocs-google-translate/commit/)
[![PyPi](https://img.shields.io/pypi/v/mkdocs-google-translate)](https://pypi.org/project/mkdocs-google-translate/)
![MIT license](https://img.shields.io/github/license/sondregronas/mkdocs-google-translate)
[![codecov](https://codecov.io/gh/sondregronas/mkdocs-google-translate/branch/main/graph/badge.svg?token=N5IDI7Q4NZ)](https://codecov.io/gh/sondregronas/mkdocs-google-translate)
A mkdocs plugin to add relative paths to Google Translate queries
![img.png](img.png)
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:
```yml
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 the `search` plugin. MkDocs enables it by default if there is no `plugins` 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.
Raw data
{
"_id": null,
"home_page": "",
"name": "mkdocs-google-translate",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "mkdocs,markdown,google,translate",
"author": "",
"author_email": "Sondre Gr\u00f8n\u00e5s <mail@sondregronas.com>",
"download_url": "https://files.pythonhosted.org/packages/28/9e/9b0f23f3c794c4b5ba8396890f94c1fb25606e17cf562961ec7c3b324743/mkdocs-google-translate-1.2.0.tar.gz",
"platform": null,
"description": "# mkdocs-google-translate\n[![Build Status](https://img.shields.io/github/actions/workflow/status/sondregronas/mkdocs-google-translate/CI.yml?branch=main)](https://github.com/sondregronas/mkdocs-google-translate/)\n[![GitHub latest commit](https://img.shields.io/github/last-commit/sondregronas/mkdocs-google-translate)](https://github.com/sondregronas/mkdocs-google-translate/commit/)\n[![PyPi](https://img.shields.io/pypi/v/mkdocs-google-translate)](https://pypi.org/project/mkdocs-google-translate/)\n![MIT license](https://img.shields.io/github/license/sondregronas/mkdocs-google-translate)\n[![codecov](https://codecov.io/gh/sondregronas/mkdocs-google-translate/branch/main/graph/badge.svg?token=N5IDI7Q4NZ)](https://codecov.io/gh/sondregronas/mkdocs-google-translate)\n\nA mkdocs plugin to add relative paths to Google Translate queries\n\n![img.png](img.png)\n\nInstall using `pip install mkdocs-google-translate`\n\n## Usage\nActivate 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:\n```yml\nextra:\n alternate:\n # Original Language\n - name: English\n lang: 'en'\n link: '%GT_RELATIVE_URL%' # For relative urls back to original language\n # Extra languages\n - name: Norsk\n lang: 'no'\n link: 'https://translate.goog/?_x_tr_sl=en&_x_tr_tl=no'\n # _x_tr_sl = source language\n # _x_tr_tl = translation language\n\nplugins:\n - search\n - google-translate:\n url: example.com # optional (required for local testing)\n```\n> **Note:** If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set, but now you have to enable it explicitly.\n\n## Incompatabilities\nThis plugin is somewhat incompatible with the mkdocs feature `navigation.instant`, due to the fact that the page heading never changes with the feature enabled.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A plugin to add relative links to Google Translate queries",
"version": "1.2.0",
"project_urls": {
"documentation": "https://github.com/sondregronas/mkdocs-google-translate",
"funding": "https://github.com/sponsors/sondregronas",
"homepage": "https://github.com/sondregronas/mkdocs-google-translate",
"issues": "https://github.com/sondregronas/mkdocs-google-translate/issues",
"repository": "https://github.com/sondregronas/mkdocs-google-translate"
},
"split_keywords": [
"mkdocs",
"markdown",
"google",
"translate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bd4b4a6a6471381f7e5cc6da077e5b3c005bbcdad1c93bc6df4d8520c91a5084",
"md5": "0b5cf624c9a8f6307f069756ce0028d2",
"sha256": "b3cbeef7263be25e10b99da3fbe08c85b5206afee42cc3fc7e2b11007d6a4d8b"
},
"downloads": -1,
"filename": "mkdocs_google_translate-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b5cf624c9a8f6307f069756ce0028d2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4553,
"upload_time": "2023-10-23T14:59:38",
"upload_time_iso_8601": "2023-10-23T14:59:38.592073Z",
"url": "https://files.pythonhosted.org/packages/bd/4b/4a6a6471381f7e5cc6da077e5b3c005bbcdad1c93bc6df4d8520c91a5084/mkdocs_google_translate-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "289e9b0f23f3c794c4b5ba8396890f94c1fb25606e17cf562961ec7c3b324743",
"md5": "bb09a3529da7541897ac3b53c86332b8",
"sha256": "23cb3b7055971d53e75e8cd6a653f6207031017c1811f609c380aa0fc3de1756"
},
"downloads": -1,
"filename": "mkdocs-google-translate-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "bb09a3529da7541897ac3b53c86332b8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4427,
"upload_time": "2023-10-23T14:59:40",
"upload_time_iso_8601": "2023-10-23T14:59:40.240334Z",
"url": "https://files.pythonhosted.org/packages/28/9e/9b0f23f3c794c4b5ba8396890f94c1fb25606e17cf562961ec7c3b324743/mkdocs-google-translate-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-23 14:59:40",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "sondregronas",
"github_project": "mkdocs-google-translate",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "mkdocs-google-translate"
}