Multilingual views in Drupal when using i18n module
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 -
- Download the insert_view module http://drupal.org/project/insert_view
- Follow this guide to configure your filters
- 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)
- Create a new node and insert your view into it using the view filter tag [view:name of view]
- Translate this node into each target language, each translation can have its own menu entry
- Sit back and relax :)