When using Drupals Internationalization Module http://drupal.org/project/i18n translated terms don't switch their language in Taxonomy Filter Blocks when switching the sites language.

CommentFileSizeAuthor
#6 tf_714858_1.patch1.13 KBsolotandem

Comments

solotandem’s picture

Assigned: Unassigned » solotandem
Category: bug » feature

Thanks for the suggestion. I have marked this as a feature request.

Can you provide a patch to implement this?

ak’s picture

Hi, until now I only can share my research. The add on module of Search Lucene API http://drupal.org/project/i18nluceneapi provides the sensible display of translated terms. Yet I wasn't able to extract useful code out of it to implement this feature elsewhere. Btw, the views module doesn't handle translated terms right as well.

ak’s picture

After a little more research I got a simple snipped that displays terms correctly while respecting the sites language. However I searched in taxonomy_filter.module but couldn't locate where the term link name is build to replace it. Well, here's the code that respects translated terms. It shouldn't be al that hard to implement this feature. Do you have a hint where this must be implemented in your module?

$vid = 1; /* <---- put correct vocabulary ID here */
$terms = taxonomy_get_tree($vid);
print "<div class=\"item-list\"><ul>";
foreach ( $terms as $term ) {
print "<li>".
l(tt("taxonomy:term:$term->tid:name", $term->name),'taxonomy/term/'.$term->tid, array('title' => $term->name)).
"</li>";
} /* end foreach */
print "</ul></div>";

where tt() does the magic to display the right translation of the term name …

tt("taxonomy:term:$term->tid:name", $term->name)

Please help, this would be a great feature for your great module.

solotandem’s picture

Thanks for doing the research. Let me see if I can implement this in the next 7 days.

ak’s picture

Hi there, have you had a look on this jet? Greets!

solotandem’s picture

StatusFileSize
new1.13 KB

Would you be able to test the attached patch and report back your results along with a description of how you tested the patch (e.g. the test environment of nodes, taxonomy, etc.)?

majabee’s picture

Hi, many thanks for this patch.I tested it and it works really good for taxonomy terms. What I need in addition to those terms is the Vocabulary name to be displayed correctly on the sites chosen language. When I switch the language. all terms are correctly displayed in the chosen language but the Vocabulary names still remain the same. If you could enable this either, this would be fantastic.
I think it should be something like this code below.

tt("taxonomy:vocabulary:$vocabulary->vid:name", $vocabulary->name)

It would be just perfect if you could find the time to do this. Many thanks for your help anyways.
(And I apologise for my bad english.)

ludo.r’s picture

I second this feature request, as i had the same problem in an older project with vers 6.x-1.0

By the way, Apache Solr Search had the exact same issue.

Andrew Gorokhovets’s picture

Subscribe

ludo.r’s picture

No news about this issue?

It seems so natural to have taxonomy labels translated in the correct language, but i dont know how hard it is to fix this issue...

solotandem’s picture

Status: Active » Needs review

In the next dev release, implemented internationalization for the vocabulary and term names that display in a filter menu. The translation language used is the language for the global $user. Let me know if this is the way it is normally handled.

NOTE: I am asking a few people to download the dev release and try out the internationalization support. If a few people comment here with their concurrence, then I will make a new release 6.x-1.4. If there are other things to change, then we will address those items. Thanks.

Status: Needs review » Needs work

The last submitted patch, tf_714858_1.patch, failed testing.

solotandem’s picture

Status: Needs work » Fixed

In the absence of any negative feedback, am marking this fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.