Tips, tricks, articles, rankings for Drupal developers

How to build your Drupal 7 multilingual website (truly SEO friendly)

ballester's picture
ballester | Tue, 08/07/2014 - 19:59

Drupal 7 Core incorporated a series of modules designed to support multilingual websites but if you really want to build a Drupal 7 with multiple languages ​​and open our website to the world then we need to add some contributed modules and configure correctly.

Multilingual settings (localization settings)

First we will enable the Locale and Content translation modules, these modules are included in the Drupal Core and indispensable for a multilingual Drupal.
With these two modules enabled, we can configure as many languages ​​as you need. Find management at: /admin/config/regional/language

Setting of language to our multilingual site

Configure languages ​​with particle subdomain or domain. This will depend on the strategy and SEO multilingual website positioning. Drupal offers interesting combinations capable of adapting to the latest SEO strategies.

Installing the Internationalization module (i18n)

This Drupal module will turn our website into a multilingual website! We will need more modules but this is the most important.

Now we continue by setting ...

Strings (Translatable text formats)

The default i18n module is not configured to translate HTML strings, I think it's interesting that they can be translated. For example, often blocks our website are composed of HTML so you need to translate the translation enable Full HTML strings.

  • Translatable text formats
    • Plain text
    • Full HTML
    • Filtered HTML.
    • PHP code

If we plan to create blocks containing PHP is also possible that we are interested to mark as translatable strings in PHP.

Date format

It is a small but important detail. Drupal 7 allows us to configure different date formats and assign to each of the languages ​​of our multilingual Drupal website.
These formats will have available both the presentation layer and node within views.
To set must go to: admin/config/regional/date-time/locale

Setting the content type (nodes)

With the installation of the Internationalization (i18n) module set get the translation of the nodes optimally for SEO of each language. Actually for a page we have two nodes, one for each language. The i18n module we maintain one's relationship as a translation of the other and vice versa. Also thanks to the Internationalization module Contributions we also linked through meta hreflang different translations.

Manage Fields of content type

Sets the file fields with thematic routes, for example; sites / default / files / products /

If you want to improve the configuration file fields you can work well with these two advanced modules:
https://www.drupal.org/project/filefield_paths
https://www.drupal.org/project/file_aliases
We can create aliases for file path from tokens, with imagination and patience we can define specific routes for each language in a multilingual website.

Configuration of content type

Edit (content type configuration)

  • Publishing options
    • Multilingual suport
      • Enabled, with translation
  • Multilingual settings
    • Extended language options
      • Set current language as default for new content.
    • Extended language support
      • Normal - All enabled languages ​​will be allowed.
  • Synchronize translations
    • Set it to your liking or as specified by the web project but keep in mind that a good SEO strategy should be different images for each language with their title and alt.

Taxonomy

Sets with translation (no location) those taxonomies that have added CCK fields that are not available on location settings.

Blocks

For the blocks have two possible configurations.
The first configuration is to enable translation blocks that need translation.

  • Make this block translatable
    • This block has generated content, only the title can be translated here.
  • Show this block for These languages
    • Not mark any language

This configuration will enable us tab "translate" and allow us to translate the string through the location.
One advantage of this configuration is only have a block with different translations.

The second configuration is to determine a language for each block, the block will only appear when that language is an asset. With this configuration we have a block for each language and no translation will be handled as such. Personally I prefer the above method.

Menus

In the menus is very important to keep the items in languages ​​translated, maintain links with url friendly and avoid the 301 redirects and URL's not friendly so we will take into account when choosing the optimal configuration.
To avoid unnecessary 301 redirects and link node / xxx type we configure the menus for translation and not by location. We define the language for each of the menu items even if it means duplicating all the elements in their respective languages​​.
This setting may make us a bit more tedious link management but is optimal for the SEO of our multilingual website.

Other essential modules for our multilingual Drupal

Localization update module

This module allows us to automatically retrieve the translations of the contributed modules repository localize.drupal.org

Path Auto

This module allows you to define patterns to create semantic for each content type and taxonomy vocabularies routes. You can use tokens or literals. It is very important that you do for each of the languages ​​of the website. By default the Path Auto module does not support multilingual taxonomy terms but you can install the Pathauto module i18n taxonomy.

Meta tags

You can use tokens to define different metatags and so the token itself will show the translated version, for example; the node title, description, etc ...

Webforms

If you are using webforms multilingual website I recommend you add the Localization Webform module. Webform localization synchronizes form fields through the translation and translations to create each field node. The configuration of this module is within each node webform "Form settings", divided into 2 sections:

  • SHOWLOCALIZATION STRING TRANSLATION BY
  • SHOWLOCALIZATION BY SYNC

Think about your options and choose the one that best suits your needs, this part is not easy.

Multilingual Views

The Views module is essential to build most Drupal 7 web site, therefore we must give support to the location.

Thanks to Internationalization Views module we can create views for multilingual websites.

The i18n Page Views module extends the functionality of the Views module allowing to define a separate access route for each language. Do write semantic routes for each language, you know, SEO friendly.

Variable module

It allows us to translate variables or contributed Drupal modules. The most common variables that need to be translated are: Website Name, Slogan website, Default home page, etc ...

Global redirect

When configuring the Global Redirect module is a very interesting option for my essential:

  • Language Path Checking (check it)
    • If enabled, the module will check that the page being viewed matches the language in the URL or the system default. For example, viewing a French node while the site is in English will cause a redirect to the English node.

XML sitemap

Do not forget to configure XML sitemap module to generate a different XML for each language.

File (field) paths module

This is a module that allows us to define the path where to store the resources field fields (images, PDF files, etc ...) using tokens. It is quite complicated to set up but it can be an advantage in our multilingual website, and we can use the tokens with the name of the content type (translated) and obtain specific routes for each language semantics.

Translation table module

It is a module with a UI that helps us manage more comfortable and effective translations of menus, taxonomies, content types and fields.

Contributions Internationalization module

When working with translated Drupal nodes maintains a relationship between the 2 nodes (one is a translation of the other and vice versa).

The Contributions Internationalization module consists of 4 modules, two of them allow to keep references synchronized node and/or entity (CCK field) between the translated nodes greatly facilitating management of content. This option is set for each field on the tab management content type "synchronize translations".

In addition, the Contributions Internationalization provides support for multilingual sites hreflang (SEO hreflang).

Another feature built into this module and that makes life easier when managing the links menu is that we filter menu items based on the language of the node. Thus we see duplicate menu items.

Selection of contributed modules to support the internationalzation of Drupal 7 multilingual website

Internationalization (I18n)
https://www.drupal.org/project/i18n

Internationalization Views
https://www.drupal.org/project/i18nviews

I18n page views
https://www.drupal.org/project/i18_page_views

Path Auto
https://www.drupal.org/project/pathauto

Pathauto i18n taxonomy
https://www.drupal.org/project/pathauto_i18n_taxonomy

Variable
http://drupal.org/project/variable

Localization update
https://www.drupal.org/project/l10n_update

Translation table
https://www.drupal.org/project/translation_table

Internationalization contributions
https://www.drupal.org/project/i18n_contrib

Webform Localization
https://www.drupal.org/project/webform_localization

Global Redirect
https://www.drupal.org/project/globalredirect

XML sitemap
https://www.drupal.org/project/xmlsitemap

File (field) path
https://www.drupal.org/project/filefield_paths