Mike Slinn


Published 2023-12-27.
Time to read: 1 minutes.

This page is part of the jekyll_plugins collection.

This Jekyll plugin provides two tags that include a Google Translate pull-down into a web page.

The {% google_translate_html %} tag must be called to insert HTML into the page, then the {% google_translate_javascript %} tag must be called to insert Javascript into the page.


Add the following highlighted line to your Jekyll project's Gemfile, within the jekyll_plugins group:

group :jekyll_plugins do 
  gem 'jekyll_google_translate'

And then execute:

$ bundle

Copy demo/assets/css/jekyll_google_translate.css to your Jekyll web site’s CSS directory, and update your layout accordingly.


<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
    <link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: nowMillis }}" type="text/css">
    <link rel="stylesheet" href="{{ '/assets/css/jekyll_google_translate.css?v=' | append: nowMillis }}" type="text/css">
    <nav id="sidebar">
      {% google_translate_html %}
  {% google_translate_javascript %}

The above is usually incorporated into a layout, for example, _layouts/default.html.

* indicates a required field.

Please select the following to receive Mike Slinn’s newsletter:

You can unsubscribe at any time by clicking the link in the footer of emails.

Mike Slinn uses Mailchimp as his marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp’s privacy practices.