Correct Way to Translate Content in Drupal

Ok, this will be a small post about keeping a multilanguage web page in Drupal7. As you know  Drupal is powerfull, but a bit complicate when configuring it. This WILL NOT be a tutorial, but a general map of instruction to translate your website. So let's see howto do it.

How Drupal knows what is the current language on your page.

There's a lot of ways of how drupal can recognise the current language. In fact you choose one when configuring the languages that are going to be on Drupal. But I really recommend using the URL method. This work as follow. Suppose you have a domain www.domain.com. When using URL for internationalization, your webpage in spanish are going to be on www.domain.com/es. So your node1 should be www.domain.com/es/node/1, in english it will be www.domain.com/en/node/2 (node2 because that's your translated module). There are other ways like having a global variable, but it will mess up your SEO, because google really hates having the same URL with different content (ok, its the same content but in a different language).


Translating Content

For translating content, you have to install the i18n module. When installed, a new tab called translate will appear when editing your node. The way you translate a content is creating a new node that is related to the original node. 

Translating WebForms

This will be the same as content. You create a clon of the original webform and relate it to the original.


Translating Blocks

You are going to need to activate the block Language Module. Works the same as Content.

Translating things in Views

So, lets say you create your awesome view and have put some global text button, or put a main title on it. the way you have to translate that is using the Content Translation module that comes with core of Drupal. After that you have to search for the string you want to translate, include the HTML if your title or global text have that, or else it will not appear in your search list. But!, and this is a very big but, when translating string, make sure youre currently on the language the translate string is. For example is you create a title in Spanish, let's say "Hola Mundo" (yes with the span tags to separe Hola from Mundo), you have to search that string using the admin in spanish, like www.domain.com/es/admin/translateblahblah or else your string will appear in the wrong language.

Menus and URL

This is the last thing you want to translate. For me its easy to create a new menu item in a different language. And why do it last? Because the URL of your content will exist only after your content is created. 

So, what thing's cannot be done easily?

My only problem right now is looking  for a way to translate the URL of a View in Page form. If you know, please tell me in the comment. Good luck!


2 comments:

Cosette Malinowski said...

Hello! For Drupal internationalization, I recommend this online translation platform with crowdsourcing potential: https://poeditor.com/
It reall spares a lot of pain from the management process.

Carlos Tamayo said...

Do you work there or just love that product? And does it work directly with drupal? Does it do something else apart from being a .po file editor?