Drupal - How can I filter the taxonomy terms by language?

By enabling the module Internationalization Views, the option to filter the taxonomy term by the language is available. Note that the version is currently in dev but it works like a charm.

screenshot showing effect of installing i18nviews


You can use the Internationalization Views module in combination with the Taxonomy Translation module (which is part of Internationalization) to get a language filter for taxonomy terms.

Translate views using Internationalization. This is a work in progress and not all Views properties can be translated yet. Requires Internationalization 6.x-1.5 or newer.


Here is another solution:

function mymodule_views_query_alter(&$view, &$query) {
  if ($view->name == 'yourviewmachinename') {
    $query->where[] = array(
      'conditions' => array(array(
        'field' => 'taxonomy_term_data.language',
        'value' => array('***CURRENT_LANGUAGE***'),
        'operator' => 'in',
      )),
      'args' => array(),
      'type' => 'AND',
    );
  }
}

Source here.