Skip to main content

Multilingual views in Drupal when using i18n module

An article from ComputerMinds - Building with Drupal in the UK since 2005
1st Mar 2008

Mike Dixon

Senior Mind
Hey, you seem to look at this article a lot! Why not Bookmark this article so you can find it easily in the future?

Building multilingual sites in Drupal using the i18n module always throws up a few fun problems to be solved. One of the most awkward being views.

The i18n views integration module does an excellent job of allowing you to return only nodes matching a particular language, but it doesn't help when it comes to translating the view itself - and more importantly allowing a view to site nicely into multiple positions in the menu (one per language).

The solution is to use the excellent insert view module (http://drupal.org/project/insert_view - you can use this guide to get the module and filter working - http://drupal.org/node/85769) to embed a view directly into a node. We will then translate the node (getting a new menu item for each language as you would with a normal node). You can optionally specify a different view per language (to enable you to translate things like the empty text), or just use the same view accross all languages.

And thats all there is to it! Just to recap -

  1. Download the insert_view module http://drupal.org/project/insert_view
  2. Follow this guide to configure your filters
  3. Set up your view, and optionally a version of your view for each target language (if you have text within the view that requires translation)
  4. Create a new node and insert your view into it using the view filter tag [view:name of view]
  5. Translate this node into each target language, each translation can have its own menu entry
  6. Sit back and relax :)

Hi, thanks for reading

ComputerMinds are the UK’s Drupal specialists with offices in Bristol and Coventry. We offer a range of Drupal services including Consultancy, Development, Training and Support. Whatever your Drupal problem, we can help.