Translating Content with Drupal
A common request that seems simple at a glance but can be very complicated is translating your content. There are a number of ways to do this:
- Machine Translation: You have a service like google translate to convert your text into other languages directly, but these will often make bad gramatical and other mistakes that a human will not make.
- Human Translation: You have a people that manually translate your text into other languages, usually these are on staff or people you have contracted with.
- Translation through a service: This can either be machine or human, or both, and involves sending off your site's text to the service and waiting for them to go through their process.
The interface for this is usually just a language selection or links that loads your website in another language, though this can also be done by subdomain (fr.example.com) or path prefix (www.example.com/fr). A lot of the time when people talk about translation they're actually talking about localization, so before going forward I will define the difference.
- Translation: Word for word translation from one language to another, this is all about the language and not specific to regions that speak the same language but differently.
- Localization (L10N): Translating content with a particular culture, country, or region in mind. This involves translating idioms, analogies, etc to fit the targeted region. You might have a translation for England, Australia, or United States even though they all speak English. Another reason to do this may be legal or for ecommerce sites and others that offer different products/services depending on the region.
- Internationalization (I18N): This refers to the act of converting your website to work in another language, such as switching from ltr to rtl page layouts for arabic and other languages. Basically this doesn't do any actual translation, but makes it so your site can potentially be translated.
One of the easiest and cheapest ways to translate a site is to just add a google translate widget to your site and let it do the work for you. This means there's branding for google, but it also helps people to understand why the translation isn't 100%, since they know that google translations aren't the best. In drupal you can either directly embed it or use one of several modules. This does remove any control over the translation you might want though. The average expensive way is to work with any number of translation services out there that will have a human review or write the translation for you, at a cost per page. In Drupal we can easily use services supported by the Translation Management module, as well as several others that are tailored to individual services. The most expensive way is to handle it in house or with contractors, though you may already have people who can do this as a large corporation, so that will make it actually the best way in those cases.
Drupal has the old way of translating content where it creates duplicate content (nodes) on different paths for everything, this leads to a lot of issues with SEO, menus, etc. though they can be worked around. The new way of implementing it with entities. This uses the entity translate module, now part of Drupal 8 core, and means you can translate the individual fields on each of your nodes or not translate them, all on the same node or piece of content. Basically you can pick and choose what on your piece of content can be translated, either just the body, or maybe an image is translated, or maybe not and it's shared between all the translations. This both simplifies editing the content and controlling the ouput of the content.
Drupal themes and modules also come with translations into various languages a lot of the time, in case your admin interface needs to be updated for these other languages as well. A typical set of modules we would use is: