If someone wants to show the term translated with this module, must edit the function (into the file: global_filter.widgets.inc):

function _global_filter_add_terms(&$options, $vocabulary_machine_name, $show_depth = TRUE)

The line:

$options[$term->tid] = $show_depth ? (str_repeat('-', $term->depth) . $term->name) : $term->name;

must be changed with:

$options[$term->tid] = $show_depth ? (str_repeat('-', $term->depth) . i18n_taxonomy_term_name($term)) : i18n_taxonomy_term_name($term);

Please, add this code to the new version for fix the multilanguage issue.

CommentFileSizeAuthor
#3 global_filter.widgets.i18n_taxonomy.patch638 bytescsedax90
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RdeBoer’s picture

Title: Show Taxonomy Term translated (width i18n) » Show Taxonomy Term translated (using i18n)

Thanks for this Crisitan

Applied with attribution (your first acknowledged patch, see https://drupal.org/user/1343484 !).

The code will only work when the i18n_taxonomy submodule in the "Internationalization" module is enabled so I modified your code a little to take care of this:

      $term_name = module_exists('i18n_taxonomy') ? i18n_taxonomy_term_name($term) : $term->name;
      $options[$term->tid] = $show_depth ? (str_repeat('-', $term->depth) . $term_name) : $term_name;

Thanks again,
Rik

PS: in the future it would be even more helpful to the maintainer if you could create a proper patch, see https://drupal.org/node/367392

RdeBoer’s picture

Status: Active » Closed (fixed)
csedax90’s picture

Version: 7.x-1.x-dev » 7.x-1.12
Status: Closed (fixed) » Needs review
FileSize
638 bytes

I've seen that in the latest stable version of the module, our multi language approach is not included, so i've created a patch (it's my first patch so I hope it goes well...)
Thanks for RdeBoer for the latest part

alanburke’s picture

Patch working as advertised - thanks.

RdeBoer’s picture

So sorry i completely forgot to apply!
Will do that when i am next to a computer.

RdeBoer’s picture

Status: Needs review » Closed (fixed)

Actually it was committed with attribution in March 2014 and thus available in 7.x-1.x-dev, but not official, until today.... I've just created 7.x-1.13

Original commit:
https://www.drupal.org/commitlog/commit/30274/7f268703ee436292701d14dd38...