DeepL is an AI powered translation service that includes API endpoints for quick use in translating content. The following article discusses the setup and configuration of the Translation Management Tool and DeepL Integration modules for Drupal 10 to take advantage of the DeepL API service.
DeepL Account
The first step of this process is to create an account from the DeepL website (deepl.com) and add a subscription that allows you to use the translation API. It is recommended to start with the DeepL API Free plan to reduce the risk of any unexpected charges during the setup and configuration process. The next step is to generate an API key from the account management area of the site, which will be used by the Drupal site to connect and process translation requests.
Drupal Modules
The following are the required modules that enable site translation using DeepL API endpoints:
- Language (language): adds translation fields for content you specify as translatable.
- Translation Management Tool (tmgmt): adds interface tool set to simplify managing translation.
- TMGMT DeepL Integration (tmgmt_deepl): adds the DeepL translation provider used to translate content.
Install and enable all of these modules along with the Translation Management Tool components Config Entity Source (tmgmt_config) and Content Entity Source (tmgmt_content), which extend the management of translations and translation jobs surrounding configuration and content.
DeepL Integration
Once this is done, there are several site specific configuration settings that will need to be adjusted. The first is to add the DeepL API language provider from the “Translation” > “Providers” area. This is where the API key obtained from the DeepL account will be set for the site. Next, the content type field translatability will need to be configured from the site’s specific needs. It is recommended to only select the fields that need to be translated for display. For example, layout or styling fields should be excluded from translation as the translated classes will not be defined in the theme styles by default.
Adding a Language
The final step before actual content translation is to add the specific languages the site will be displayed in. This can be done from the “Regions and language” > “Languages” area. It is recommended to start with a single language and finish the translation work for that one before adding the next as translating all content of a site can cause the free translation limit to be reached fairly quickly. Upgrading to a DeepL API Pro plan will likely be required for any site with significant content.
This concludes this article on the initial setup of DeepL translation support for a Drupal 10 site. For more information on using this integration to translate the actual content of the site, visit the follow-up article “Translating Drupal Content Using DeepL”
Need a fresh perspective on a tough project?
Let’s talk about how RDG can help.