Automatic Translation
The Automatic Translation page from TranslatePress lets you enable and configure the automatic translation of your website content through the available APIs.
The free version of TranslatePress lets you use the Google Translate v2 API, while the paid versions also offer an integration with the DeepL API.
In order to use these APIs you will need to create an account with the vendor and get a key. Access to these APIs is not granted with a TranslatePress licence. For more info, refer to the pages below:
- How to generate a Google API key
- How to generate DeepL API key
To minimize translation costs, each untranslated string is automatically translated only once, then stored in the database.
Automatic Translation Settings
There are a few settings that you can configure when setting up the Automatic Translation feature.
Block Crawlers – if you enable this option, crawlers that are indexing your website will not trigger the automatic translation of your website
Limit machine translation / characters per day – this option lets you limit the amount of characters that the plugin translates through the selected translation API each day.
The default limit is set at 1 000 000 characters but you can adjust this to your liking. The main purpose of this option is to limit the overall costs that you experience from the translation API.
Log machine translation queries – this option is only recommended for testing and debugging as it might affect performance.
By enabling it, every request that is made to the selected translation API will be logged in your database so you can inspect it.
Generate Google API Key
Setting up API keys for Google Translate
This step by step tutorial will guide you though generating a Google Translate API Key.
- Create a new Project
- Go to API Services
- Create new API key
- Restrict API to particular website
- Restrict usage to control costs – Important!
- Copy API key
- Paste into TranslatePress Settings
In order to create a Google Translate API Key you need a paid account. Through their terms and services, Google doesn’t allow for non-paid usage of their Translation API.
More information is available at: https://cloud.google.com/translate/
To create your application’s API key simply follow the steps below:
Go to the Cloud Platform Console.
1. Create a new Project from the top bar.
2. With the new project selected, go to the hamburger menu to the left and visit API & Services
From Dashboard enable Google Translate API
Search for translate API and enable it
3. From the credentials interface create a new API Key.
4. Restrict your API Key to a particular website
In Google Dashboard, use the HTTP Referrer provided in the description of the Google Translate API Key field in Settings -> TranslatePress -> Automatic Translation tab, as shown in the following screenshot.
5. Restrict Usage of API
In order to have control over the cost of Google Translate API, it is highly recommended to set quotas to limit the usage.
Go to Google API’s & Services → Dashboard → Cloud Translation API → Quotas and set up quotas as shown in the following screenshot.
6. Copy your API Key for use in TranslatePress
7. Enable Automatic Translation and add Google Translate API Key in TranslatePress
TranslatePress lets you automatically translate your WordPress site by using Google Translate.
TranslatePress is the easiest way to translate your WordPress site. It’s fast, won’t slow down your website, works with ANY theme or plugin and it’s SEO friendly.GET THE PLUGIN
For this navigate to TranslatePress -> Settings , and make sure to Enable Automatic Translation, by setting it to Yes. Then, under Translation Engine, select Google Translate v2.
This will uncover the Google Translate API key field. Place the API key in this field and Save Changes.
That’s it! You can now simply navigate to the front-end of your website and browse it in the language of your choice. You’ll notice the content has been automatically translated.
DeepL Automatic Translation
The DeepL Automatic Translation Add-on is only available with a Developer or Business licence.
The DeepL Automatic Translation add-on for TranslatePress lets you automatically translate your website through the DeepL API.
DeepL is a very powerful machine translation tool backed by artificial intelligence and neural networks.
To check the list of supported languages, please go to this page.
Installing the DeepL Automatic Translation Add-on
The add-on is available for download from your account.
Once downloaded it can be installed just like any normal WordPress plugin.
How to generate DeepL API key
In order to use the API, you will need to get a key.
The key can be purchased by following this URL: https://www.deepl.com/pro.html#developer
The package that contains API access is listed under For Developers -> DeepL API and it costs 4.99€ + usage fees.
After you’ve created the account for DeepL go to your Account page where you will find your API key:
COST CONTROL
From your DeepL Account Page you can also control the overall costs that you might experience by using the API.
To do this, go to your DeepL Account Page and then click on Change cost control settings.
To activate cost control, check the box and then you can configure the Maximum total monthly price and the Maximum total monthly usage.