manage a site multilingual Terms & views filter

Events happening in the community are now at Drupal community events on www.drupal.org.
avior's picture

Hi
I have a multilingual site, I want to be able to have a view filtered by term (by the current language)
What is the correct way to do this ?

i have drupal 5, i18n 5.23 and enabled all experimental modules & views 1.6

I can create terms in the langs and sync the translation via [site]/admin/content/taxonomy/XX/translation

my problem when using views filters , i am using the english interface , so i see only the english terms.

The english version of the view works ok (en/VIEWNAME), but when i go to the other lang (he/VIEWPATH) no hebrew items are displayed ,
does the terms supposed to be translated ?
what am i'm missing here ?

maybe another way doing that would be to define a term and not attach it to a specific lang
and translate the term string , is that way right ?

Thanks , Avior

Comments

Found the solution

avior's picture

The Solution is to add to the filters

  1. Internationalization: Selection : "is" only current lang and .... (select what is needed)
  2. the termid , and change the values by arguments code

in this code sample the the vocabulary is number 4 , and the term id for all 3 langs are 9,27,126

foreach ($view->filter as $key => $filter) {
  if ($filter['field'] == 'term_node_4.tid') {
    // Enter the term ids of all laguages here:
    $view->filter[$key]['value'] = array(9, 27, 126);
  }
}

I'm not clear on what the problem is but...



Currently part of the team at https://lastcallmedia.com in a senior Drupal specialist role.

Internationalization

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: