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.
I use i18ntaxonomy and noticed that it doesn't translate terms when they are displaying in Views. I think it's bad and created a patch to translate taxonomy terms' names in views. It implements hook_views_data_alter() and changes standard handler to one, which extends it and adds i18nstrings() translate wrapper.
Please review it and, if needed, commit.
I didn't understand how to create new folders with CVS patches, so there are two separated files: patch for i18ntaxonomy.module and 'views' folder.
Comment | File | Size | Author |
---|---|---|---|
#2 | i18ntaxonomy.patch | 729 bytes | yeputons |
#2 | i18ntaxonomy.zip | 1.04 KB | yeputons |
#10 | views.zip | 2.62 KB | yeputons |
Comments
Comment #1
luco CreditAttribution: luco commentedhey man,
same here. how come no one saw this coming?
anyways, I can apply the patch on my website and test it. would you like me to? simply attach your files to this issue and I'll check back later.
cheers,
Luciano
Comment #2
yeputons CreditAttribution: yeputons commentedI'm really sorry, but the attachments system doesn't like me :(
UPD: don't use *.zip from this message. Use one from post #10 instead (in this post there is only translation of 'Term: Name' , neither for 'Term: Description', nor for 'All terms').
Comment #3
luco CreditAttribution: luco commentedthanks. I've applied the patch against i18ntaxonomy.module and placed the
views
folder undersites/all/modules/i18n/i18ntaxonomy
- but nothing changed.my terms in Portuguese still appear in English when you view a full node - but not when you access a view.
check out the difference by visiting my blog: http://luco.ws/en/blog and selecting a post.
Comment #4
yeputons CreditAttribution: yeputons commentedDid you clear Views' cache? Also you may need to resave your views (to update handler information).
Comment #5
luco CreditAttribution: luco commentedI use the Administration menu's "clear all caches" command quite often ;]
and I tried to open and resave my view as well. neither worked :/
btw where exactly should I drop those .inc files?
Comment #6
yeputons CreditAttribution: yeputons commentedi18n/i18ntaxonomy/views/i18ntaxonomy.views.inc
i18n/i18ntaxonomy/views/i18ntaxonomy_handler_field_taxonomy.inc
On my site 'Clear all caches' doesn't clear Views cache. Try it?
Comment #7
luco CreditAttribution: luco commentedwell, the files are in place and I had already saved my view. I even removed the taxonomy field, saved, closed; then added that field back again, saved and closed.
I also cleared the Views' cache in
admin/build/views/tools
.still no joy. any suggestions?
Comment #8
yeputons CreditAttribution: yeputons commentedWhat you see at admin/build/translate in the 'Taxonomy' column? You should not see 0/125, but 125/125.
P.S. my patch translates only 'Taxonomy: Term' field, neither 'Taxonomy: Term description', nor 'Taxonomy: Vocabulary name'
Comment #9
luco CreditAttribution: luco commentedwell my website's default language is Portuguese.
for PT-BR (Brazillian Portuguese) there's 0/42, but in English there's 22/42.
in English, some strings are translated, while for others there's no need - like interfaces (which is a cognate) or gadgets (which is used in Brazil as well).
you can see that it only happens in a view; when you access the node itself, translations work.
anyways, man, you're being a great help. please don't give up on me :)
edit: I've noticed that if I use "Taxonomy: Terms" instead of "Taxonomy: All terms", it shows up in English. BUT that generates duplicates.
maybe there's some setting I'm missing for my vocabulary, or language negotiation ... ?
Comment #10
yeputons CreditAttribution: yeputons commentedNo, it's normal. "Taxonomy: All terms" translation is not implemented yet. But test version is available (in attachments). Unzip it to i18ntaxonomy/views with replacement of all old files, clear Views' cache and enjoy :)
Comment #11
luco CreditAttribution: luco commentedit worked! :) thank you so much. they should get this change commited ASAP.
cheers
Comment #12
esclapes CreditAttribution: esclapes commentedsubscribe
Comment #13
odisei CreditAttribution: odisei commented+1
Comment #14
YK85 CreditAttribution: YK85 commented+1 subscribing
Comment #15
Raphael Apard CreditAttribution: Raphael Apard commentedUsing module PHP Custom code, you can translate terms name.
I add a PHP custom code with php code :
Comment #16
Pollydor CreditAttribution: Pollydor commentedsubscribe
Comment #17
murmel CreditAttribution: murmel commentedI didn't get the code on # 15 to work, maybe I put it in the wrong place.
This code is a little remake of the code above, and will work if you put it in a views theme file.
Comment #18
wuh CreditAttribution: wuh commentedPatch in #2 and the zip file in #10 work for me on 6.x-1.x-dev, 2010-Sep-21
Please commit!
Comment #19
drifter CreditAttribution: drifter commentedI can too confirm that the patch works nicely. Does this belong in i18ntaxonomy, or i18nviews?
Comment #20
jhodgdonI made a patch for a related issue at #976872: Taxonomy terms are not translated in Views, although it was a patch against the Views module, so not really ready to be added to Internationalization.
See also #530354: When grouping a view on taxonomy term, term is not translated, which appears to be related.
Comment #21
mandreato CreditAttribution: mandreato commentedsubscribe
Comment #22
benklocek CreditAttribution: benklocek commentedSubscribe
Comment #23
rmontero CreditAttribution: rmontero commentedSubscribe
Comment #24
jonaswouters CreditAttribution: jonaswouters commentedSubscribing.
Any update on this?
Comment #25
gandhiano CreditAttribution: gandhiano commentedI confirm that this bug exists in i18n 6.x-1.7 and that patch in #2 + zip in #10 function properly.
Comment #26
Jose Reyero CreditAttribution: Jose Reyero commentedNo views here, maybe for this other module.
Comment #27
Solariss CreditAttribution: Solariss commentedYes #2 + #10 covers problem if you use taxonomy as regular view field.
But I use taxonomy as argument for a title of display "Nodes in category: %1" and unfortunately this patch doesnt cover this problem :-(
Does any one can help me?
Comment #28
jhodgdonRE #27 - see comment #20 above.
Comment #29
SaxxIng CreditAttribution: SaxxIng commentedI confirm using last 2.x-dev also "taxonomy: All terms" works well!
Comment #30
goofrider CreditAttribution: goofrider commented@Solariss #27
I'm having the same problem, I'm using %1 as my Views title and breadcrumb (the argument is a termid with depth ), the title displayed would be in English only and not translated according to current language.
I;m using Views 6.x-2.12
Comment #31
YK85 CreditAttribution: YK85 commentedHello, I was wondering if there may have been further development? Thank you!
Comment #32
Marko B CreditAttribution: Marko B commentedConfirming latest dev works ok for taxonomy all_terms but in summary arguments section its not working.
Comment #33
Summit CreditAttribution: Summit commentedSubscribing,
edit: I had to visit [website]admin/build/translate/refresh and now my terms are available for string translation and that is working with newest views 3.dev.
argument section is not working in 2.dev and 3.dev. Greetings, Martijn
Comment #34
Lukas von Blarer#10: uhm... where do i put these files? is this still compatible? if yes, why has this no been committed yet?
Comment #35
Stolzenhain CreditAttribution: Stolzenhain commentedsubscribing
Comment #36
ytsejam CreditAttribution: ytsejam commentedPatch works beautifully with me, really needs to be committed!
Comment #37
drifter CreditAttribution: drifter commentedThere have been enough confirmations I think.