Skip to main content

Translating Drupal Content Using DeepL

Drupal

DeepL is an AI powered translation service that includes API endpoints for quick use in translating content. The following article discusses how to use the Translation Management Tool interface in Drupal 10 to translate the site’s content using the DeepL API service. See “DeepL Drupal Translation Setup” for more information on how to set up a DeepL API subscription and how to configure a Drupal 10 site to take advantage of this service.

Translatable Content

There are two distinct types of content that can be translated for a Drupal 10 site, user interface strings and entity content. User interface strings are usually single words or short phrases that are added to the page via code. Many modules that add this type of content include their own translations, which are imported when the language is enabled for the site automatically. Some of these strings and some values that can be defined through the configuration of the site will require custom translations to be given.

User Interface Strings

Even though there is a way to export all of these strings for a single bulk translation through the DeepL website, it is highly recommended to only translate the strings that are actually displayed. This is due in large part to some of the user interface strings containing html elements that include class names that most translators will not handle correctly. It is recommended that as strings are found that need translation while viewing content in the translated language, they are individually passed into DeepL’s “Translate text” form on their website for translation and updated in the “Region and language” > “User interface translation” list.

Content Translation

As for the bulk of the site, translation will mainly be on content created by and are stored in the database. These can be translated either individually, or in bulk, and can be accessed and edited as needed from the individual content’s “Translate” page.

Bulk Content Translation

For bulk content translation, the “Translation” > “Sources” interface allows for quick filtering and creation of translation requests for the site’s content. It is highly recommended that translations be done for not only the node based content (pages, articles, etc) but also some of the additional content types in use. The additional content types may include Menus, Custom menu links, Content blocks, and Taxonomy terms. It is recommended to use this process when adding support for a new language especially if the site is already populated with a large amount of content.

Individual Content Translation

For individual content translation, the content or entity will have a Translate tab that will allow for requesting of a new translation. Depending on settings, selecting the language and clicking “Request translation” will either put it in the cart to be translated by someone with the appropriate permissions or send the request to DeepL using its API endpoints. It is recommended to use this process when adding new content that needs translation for the already supported languages.

Need a fresh perspective on a tough project?

Let’s talk about how RDG can help.

Contact Us