Plugin Store

Official plugins

Page Translate — a translate button for your pages

The official Page Translate plugin — a floating button that lets visitors translate the page into 7 languages, free through Google Translate or with the Google Cloud Translation API and a cache

4 min readLast updated

View as Markdown

On this page

The Page Translate plugin (page-translate) adds a floating 🌐 button at the bottom right of every page. Visitors translate the page into English, ไทย, 日本語, 简体中文, 繁體中文, 한국어 or Tiếng Việt, and press Show original to go back.

The translate button and language menu on a page
The translate button and language menu on a page

Choosing a mode#

Free (default)Google Cloud Translation API
CostNone, no API key needed500,000 characters/month free, then pay as you go
How it translatesThe Google Translate Website Widget translates the whole page after a reloadSends text in batches and keeps the results in the browser (no repeat translations)
Best forMost sitesSites that need stability and control

In API mode the plugin skips code (<code> <pre>), scripts and anything with class="notranslate" or translate="no", and also translates text loaded later (such as post lists).

Settings#

Left menu Translation (settings)

The Translation settings page
The Translation settings page
  1. Translation mode — free or Google Cloud Translation API
  2. The site's original language — ไทย, English, 日本語 or 中文
  3. Button colour — to match your theme
  4. Button position and button style (1.5.0) — move the button to another corner if it covers the page's own buttons, or choose icon only; by default only the icon shows on phones. Press Save
  5. API mode only: enter the API key and press Save key (the page shows only the last 4 characters)

Creating an API key#

  1. Google Cloud Console → select or create a project → enable the Cloud Translation API
  2. APIs & Services → Credentials → Create credentials → API key
  3. Restrict the key: Application restrictions = Websites with https://your-domain/*, and API restrictions = Cloud Translation API only

In API mode the key is in the page (the visitor's browser calls Google itself), so anyone can see it — always restrict the key as in step 3. In free mode the saved key is never put into the page.

Permissions#

PermissionMeaningDefault
page-translate.manageOpen the settings page; change the mode, original language and button colourAdministrator, Editor
page-translate.api_keyAdd, change or remove the API key (also needs manage)Administrator

Notes#

  • Free mode stores the chosen language in the googtrans cookie of this domain only — other sites under the same parent domain (e.g. shop.example.com and blog.example.com) are not translated along with it
  • Machine translation can be wrong for specific terms. Put translate="no" on brand names or product codes in the designer so they are left alone