Skip to main content

A plugin to add relative links to Google Translate queries

Project description

mkdocs-google-translate

Build Status GitHub latest commit PyPi MIT license codecov

A mkdocs plugin to add relative paths to Google Translate queries

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:

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.

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

mkdocs_google_translate-1.3.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocs_google_translate-1.3.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for mkdocs_google_translate-1.3.1.tar.gz
Algorithm Hash digest
SHA256 188e935d94154547e4eabc08096f75ae13788d9ea8bbd0940ba9156a935f7c52
MD5 35fe5a9fea31b128854781d3d53a61ca
BLAKE2b-256 3727db9b2dfb7e83c01482275b0bc4ea18a3b1fe228baac3c5ae36331f4b0995

See more details on using hashes here.

File details

Details for the file mkdocs_google_translate-1.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_google_translate-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 92cfb823513afec6401f21014e5b3a248343335d53173d59abf6ea8f0ea54f86
MD5 d57fefed4a0499f203082f7b52c9ca26
BLAKE2b-256 d5a61dd2c5372297aa4dc0fa874d9951358a15e798fc03352302592d8cfb44a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page