I've a localized taxonomy with 3 levels. In a (tabular) view displaying the node title + a column with all taxonomy terms for that node, the terms are correctly translated in the table cells.

The taxonomy is exposed to the user through an exposed filter (term ID with depth, showing hierarchy, drop down list), but the terms in the drop down list are not translated (see screenshot in attachment). The filtering actually works correctly, but it is of course confusing to the end user. Translation does work correctly on "plain" term id (without depth) by the way.

So I assume this is because there's no i18nviews_handler_filter_term_node_tid_depth (working on a quick and dirty patch)

Members fund testing for the Drupal project. Drupal Association Learn more


bart.hanssens’s picture

Status: Active » Needs review
4.97 KB

quick and dirty patch, basically just copy views_handler_filter_term_node_tid_depth from views to i18nviews, and make sure that i18nviews....tid_depth extends i18nviews...tid

christiaan_’s picture

Thank you very much for the patch - it works perfectly. Also works in 6.x-2.x-dev with views 2 exposed.

+1 for patch #1

Summit’s picture

Subscribing, I do not get any term to be translated, greetings, Martijn

bart.hanssens’s picture

Note that you may need to flush the caches (at least the Views cache)

pearlliang’s picture

Priority: Normal » Minor

Thanks bart.hanssens for the patch and thanks christiaan_ for feedback.
It works with my Durpal 6.22 website as well. I am using i18nviews 6.x-2.x-dev with views 2 filters exposed. The taxonomy were translated in views filter with term ID with depth.

mvc’s picture

works perfectly for me with drupal 6, views 6.x-2.12, i18n 6.x-1.9, and i18nviews 6.x-2.x-dev. thanks!
(not tagging RTBC because i didn't test in views 3.x)

mathieu’s picture

Subscribe. Will try later on 6.x-3.x...

j0nathan’s picture


mathieu’s picture

@bart.hanssens: the patch in #1 seems to work in 6.x-3.x-dev, except for the label of the exposed filter. I'm a bit at loss as to what needs to be added to make this work.

I'll keep searching, but if you have an idea, it would be much appreciated.

EDIT: the terms are not sorted either (they are sorted in the original language's order).

mvc’s picture

fwiw in views 2.x the label is correctly translated with this patch.

Pol’s picture

Hello all,

Here is an updated patch, working with latest dev version and using good patch syntax.

Thanks for your work Bart :-)

ShaneOnABike’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Needs review » Reviewed & tested by the community

This also worked for me against the latest dev... could we push this into the dev branch for 2.x?

miro_dietiker’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/includes/i18nviews.views.incundefined
@@ -51,6 +51,9 @@ function i18nviews_views_handlers() {
       'i18nviews_content_negotiation_filter_handler' => array(
+	  'i18nviews_handler_filter_term_node_tid_depth' => array(

+++ b/includes/i18nviews_handler_filter_term_node_tid_depth.incundefined
@@ -0,0 +1,88 @@
+ ¶
+  ¶

Trailing spaces and tabs...

+++ b/includes/i18nviews_handler_filter_term_node_tid_depth.incundefined
@@ -0,0 +1,88 @@
+ * Copy of the non-i18n views_handler_filter_term_node_tid_depth
+    $this->query->add_where(0, "$this->table_alias.$this->real_field IN ($subquery$where  )", $args);

Please write this cleaner...
Why not add the $where to $subquery as condition() like the original views_handler_filter_term_node_tid_depth does?

Rest seems fine.

aaronbauman’s picture

Issue summary: View changes