/

CM Tooltip (CMTG) - Integrations - Google Translate


Using Google Translate with the Glossary

Back to User Guide

The CM Tooltip Glossary Pro+ and eCommerce editions support adding a Google Translate API to tooltips and term pages, to help translate their content from one language to another. This feature is particularly useful in cases where a website is meant to serve a bilingual community.
Requirement: In order for the Google Translate API integration and functionality to work, the server must have a PHP cURL library installed.
You can see whether or not it is installed in the plugins System Information. You can find the System Information by following the User Guide link:

How to integrate Google translate into the glossary?

If you choose to integrate a Google Translate API, you will need to have a Google API key, which can be easily obtained from Google (this of course will cost money based on the usage).

To obtain an API key for translation please follow the Instructions from Google.

Next, enter the settings panel at Admin Dashboard → CM Tooltip → Settings → API and set the following definitions:

  • Add the API key
  • Choose a source language (language in which the original text is written).
  • Add the target language (to which the original text will be translated) Source and target languages can be also modified using the following shortcode:

Further options for the Google translate API integration:

After setting up the technical options there are two ways how the API integration can work.

  1. Check the box “Display translation and original text together?” if you want both source language and target language to appear side by side in the tooltip. If it's not checked then only the translation will be displayed.
  2. Alternatively, you can choose "Display translated term name in tooltip?" in this case, only the translated term name will be displayed in the tooltip (overwriting the term definition).

CM WordPress Plugins- Google translate API

How to exclude certain terms from using the Google translate API

Each of your term page editors contains a metabox with tooltip override settings that only apply on the specified term. 

Check the box “Disable Google API for this term” to hide the specified term’s translation on all pages and posts, as shown in the image below:

Using a shortcode

Google translate is also supported using a shortcode. This works on every post or page, not only the terms page.

The shortcode includes the following parameters.

{glossary_translate term="welcome" source="english" target="spanish"}

Please note that when using this code, you should use brackets -[]- instead of braces -{}.


More information about the CM Tooltip Glossary WordPress Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center