Blog

What’s New with Drupal Translation

19 Jul 2021 | Tech

Drupal has seen a slight dip in its market share over the last 18 months, but it still remains squarely planted in the top 10 CMS’s on the market with hundreds of thousands of websites relying on the framework. And the developers are still hard at work, with the release of Drupal 10 currently scheduled to drop June 2022. 

But, 2022 is still a ways off (at least as of the time I’m writing this), and for those of you running Drupal 9, you may have some questions about how to get your site translated.  I’m sure if you’ve read any of our past articles, I don’t need to tell you about the benefits of translation, especially if you’re targeting an international audience. Providing your offering in your target’s native language is a sure-fire way to improve your chances of closing a sale.

So, whether you already offer your content in multiple languages and are just looking to add a new market segment, or whether this is your first time delving into foreign markets, our project managers are on hand and ready to help you make your internationalization project on Drupal a success.

Taking the first steps                                                                                         

One of the small quality of life improvements you have in Drupal over certain other CMS platforms is an internationalization module that comes already included in the core system (assuming you are using Drupal 8 or later). Alongside this, a number of system messages and interface elements are already translated into numerous different languages by the community. Once you’ve selected the languages that you want, these are automatically imported with the language pack. You’ll just have to install the four modules that comprise the core of the multilingual system. These are the Language, Interface Translation, Content Translation, and Configuration Translation modules.

You’ll want to head to the Manage menu, and then look in Configuration, Regional and Language, Languages where you’ll find a list of languages you can add. After you’ve added your new language or languages, you’ll have to add a Language Switcher block that will enable your visitors to choose what language best suits them. If you need more information, all of the steps can be found on the Drupal website here.

Taking it further

Now that you’ve added your new languages, the next step is to decide what content you’re going to need translated. The core Content Translation module will allow you to translate everything from custom blocks to terms, comments, and even pages.  However, in order to facilitate interactions with an external provider, we suggest you opt for the Translation Management Tool module. This has the non-negligible advantage of enabling your content to be exported (and then re-imported) in the industry standard xliff format.

While it may be an option to just create an access for your translator to update strings in the back office, choosing to export the translations in the xliff format means that you don’t need to create another potential vulnerability with a new access code, and it also enables your translation service provider to leverage existing, or create new, translation memories. These memories will help ensure your strings are translated consistently and will allow you to save money on recurring content. With a simple xliff export, we’ll be able to find an accurate word count, taking into account repetitions, to quickly provide an accurate estimate. And since it is an industry standard, we can help optimize project management costs.

The Translation Management Tool is also fully compatible with Drupal 7, 8, and 9.

Translating Themes and Modules

Of course, not everything is always so neat and tidy. When it comes to translating strings hardcoded into your theme, you may be at the mercy of your development team. When Drupal 8 was launched, the Twig template engine was introduced. This allowed developers to take advantage of the internationalization module and specifically tag content as translatable by using the {% trans %} and {% endtrans %} tags. However, if your theme developer didn’t leverage this capacity, it will need to be manually updated by creating a copy of the theme and then using a module such as Switch Page Theme to enable a non-default theme to be used on specific pages.

Likewise, when it comes to modules, you’re again at the mercy of the developers. If they’ve used industry best practices, you should have a .po (Portable Object) file for each added language that you can simply export and have translated by your chosen language service provider.

However, if they’ve included hardcoded strings that are untranslatable, you’ll need to reach out to the developers to have the issue corrected, or manually copy it and change the code in-house if you have such capable developers on hand.

Other options

I’ve taken the time to list some of the major challenges and benefits of translating a website on the Drupal platform, but, as with everything, the list is non-exhaustive. For example, the Translation Management Tool will also allow you to work completely online via Smartling or Memsource, if you so decide. You can also opt for 100% Machine Translation through Deepl or Google Translate. While Machine Translations has come a long way, we don’t suggest you opt for this solution unless you’re going to ask a professional to provide post editing services.

If you’d like to know more about Machine Translation Post Editing, or if you have any other questions or concerns about translating a Drupal website, don’t hesitate to contact our professional and helpful project management team. We’re here to facilitate your internationalization project and ensure it is a success!