Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Title says it all... I have a view grouped on taxonomy term and I always get the default (English) no matter what. Anyone know what to do about this?
Comments
Comment #1
jrefano CreditAttribution: jrefano commentedi sorta got it to work by messing with my views-view-unformatted.tpl.php file, and instead of just printing $title i'm using:
however, this creates a NEW string, which i can easily translate, but i'd like to use the existing translation for the term. if i look at my translation interface search results, the proper textgroup and name looks something like "term:116:name" ... but since this is supposed to be multi-purpose, i can't use a static tid like that. i suppose i could look up the tid from the title text and jam it in there, but is there a way to do this i'm not understanding?
Comment #2
jrefano CreditAttribution: jrefano commentedso, i got it to work by using
but that doesnt feel like the right way. any insight greatly appreciated.
Comment #3
Nchase CreditAttribution: Nchase commentedhaving the same issue, taxonomy terms on a node sorted ascending using arguments -> no translation showing up
Comment #4
tomsm CreditAttribution: tomsm commentedI have the same issue.
Comment #5
jrefano CreditAttribution: jrefano commentedyou guys should try my theme layer fix (above). sure, it's a bit of a hack, but my site needed this functionality and i didn't have the time/expertise fix i18n views.
Comment #6
seanBI have this problem too! Am I forgetting a certain setting or is this really a bug?
Comment #7
tomsm CreditAttribution: tomsm commentedYes, you can call it a bug.
I have been waiting some time for a fix allowing translation of taxonomy terms in views.
Comment #8
hukarusai CreditAttribution: hukarusai commentedHi.. I have same problem and this is my solution.
- Edit $title in views-view-grid.tpl.php (my style)
- And use Translate interface...
Comment #9
tomsm CreditAttribution: tomsm commentedThanks for the tip. The disadvantage is that you have to translate every taxonomy term again using "Translate interface".
Comment #10
jhodgdonI think this is the same issue as #976872: Taxonomy terms are not translated in Views, which has a patch (against the Views module) to fix this problem. I'm closing the other issue as a duplicate of this one.
#845616: i18n taxonomy: translating standard Views taxonomy term field also seems to be related, and also has a patch.
Comment #11
mandreato CreditAttribution: mandreato commentedI've investigated the function
render()
in ...\sites\all\modules\views\plugins\views_plugin_style.inc and found that the taxonomy grouping term is$title
, but can't image how to translate it.Maybe it should be added a function in i18nviews to extend views_plugin_style in the same manner
i18nviews_handler_field_taxonomy
does for taxonomy terms to translate them.Comment #12
jhodgdonYou might check the patch I posted on #976872: Taxonomy terms are not translated in Views
Comment #13
mandreato CreditAttribution: mandreato commentedI'm sorry, I forgot to mention that I tried your updates on
...\sites\all\modules\views\modules\taxonomy\views_plugin_argument_validate_taxonomy_term.inc
...\sites\all\modules\views\modules\taxonomy\views_handler_argument_term_node_tid.inc
but it didn't fix this specific issue (view my bug description here: http://drupal.org/node/887720#comment-3710990).
I don't think that it's a duplicate of #976872: Taxonomy terms are not translated in Views.
Probably a fix similar to yours should be applied also to
...\sites\all\modules\views\plugins\views_plugin_style.inc
but I don't know PHP enough to do it.
Comment #14
habrda CreditAttribution: habrda commentedHi.. this is my solution
1. in View set grouping by Term ID without Label
2. Edit views-view-unformatted.tpl.php for my style and instead of just printing $title i'm using:
Comment #15
mikegstringer CreditAttribution: mikegstringer commentedI got this working using theming with a small tweak to the example code above:
In views-view-unformatted.tpl.php, change:
to:
Comment #16
yang_yi_cn CreditAttribution: yang_yi_cn commentedit should be
Comment #17
tangent CreditAttribution: tangent commentedI've run into this bug as well. Is the bug in views or in i18n? I don't have time to look at the moment so I've implemented the theme work-around above.
Is doesn't seem that blocks is the appropriate component so I'm changing it even though taxonomy might not be the right one either.
Comment #18
Jose Reyero CreditAttribution: Jose Reyero commentedMoving to the right module.
Comment #19
thelinhuk CreditAttribution: thelinhuk commentedThis method works on Drupal 7 as well, I used one of the views template, in my case views-view-unfomatted-'VIEW-NAME' and following code on template:
// Get Taxonomy translation
Comment #20
dpayk CreditAttribution: dpayk commentedJust in case someone gets here looking for a solution why group fields are not translated in a normal view: The solution is to change the "Formatter" of the field from "Default" to "Default translated".
Comment #21
hommesreponse CreditAttribution: hommesreponse commented@dpayk thank you!