Select translation implements a Views filter which allows you to select, for a group of nodes representing the same translation, which of the translation should be displayed.
In other words it provides language fallback functionality for nodes translated with Content Translation (not Entity translation) inside views listings. This is an alternative to the Views "Field Language" option which would not work for nodes translated with Content Translation.
The options are :
- Use current language ; if not available use original language
- Use current language ; if not available use default language ; if not available use original language
- Provide a list of languages, so that the most appropriate language is selected. The list can contain the special values 'current', 'default' and 'original' for, respectively, the current language, the default language and the node's original language.
Select translation also provides an API to let users select the correct translation of a given node. This can be useful in code snippets, or when writing your own module. Given a node id, the function returns the node id to display, following the same algorithm as the view filter. Usage :
<?php $my_nid = select_translation_of_node($nid); // Uses 'default' mode $my_nid = select_translation_of_node($nid, 'original'); // Uses 'original' algorithm $my_nid = select_translation_of_node($nid, array('en', 'fr', 'current')); // Returns the best match ?>
Similar project : Active translation performs a similar function but it is not a Views filter - it acts on all queries of the whole site.
Drupal 6 Compatibility
If you have i18n, you should set 'Content selection mode' to 'All content' in i18nsettings ( admin/settings/i18n )