Hey,
-- Chris, let me know if this is not an appropriate place to post this, I hope others will benefit from the announcement.
I just pushed some code to a sandbox containing a start at providing multilingual facet items. It currently only supports taxonomy-based facets but the system can be extended to support other sources.
The code is based on a suggestion from cpliakas here: http://drupal.org/node/1210730#comment-4701718.
It uses the i18n module i18n_taxonomy to retrieve translations and *should* support both localized taxonomy terms an separate language specific terms (I have only tested localized terms).
It is still a little rough around the edges and the translation handler class in particular may be a little overkill. I would greatly appreciate some feedback from those who are more familiar with both the facetapi and i18n projects.
The sandbox can be found here http://drupal.org/sandbox/thegreat/1276796.
Thanks,
Tom
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | multilingual_facet_items-1276812-8.patch | 446 bytes | guillaumev |
Comments
Comment #1
cpliakas commentedExcellent!!! Definitely the right place to post, and I am glad someone is working on this. My i18n chops are definitely not where they should be, so please post back if the API prevents you from doing what needs to be done. Thanks for the work on this!
~Chris
Comment #2
das-peter commentedsubscribe
Comment #3
zambrey commented+1
Comment #4
aroq commentedsubscribe
Comment #5
cpliakas commentedClosing as "fixed" for lack of a better option. Progress of this task should be followed at the Facetapi i18n project.
Comment #6
tnightingale commentedJust a follow up, the patch here: http://drupal.org/node/1340858#comment-5259368 solves this problem for facetapi and elsewhere. The i18n_translate module probably isn't necessary anymore.
Comment #8
guillaumev commentedI'd like to reopen this issue because, even if, it's true, the patch for the i18n module does 99% of the work, facetapi does not call the entity_label function for taxonomy terms, and still uses $term->name, resulting in taxonomy terms not being translated in facets. Here is a patch which fixes this...
Comment #9
cpliakas commentedguillaumev,
Thanks for the patch. Logic makes sense to me. I'll apply and RTBC within the next few days.
Thanks again,
Chris
Comment #10
cpliakas commentedDropped off my radar. Marking as RTBC.
Comment #11
cpliakas commentedCommitted to 7.x versions of Facet API.
Congrats on becoming the 23rd code contributor to Facet API!
Comment #13
martijn houtman commentedSomehow,
entity_label()does not translate my term labels, they still show up in the source language. Rather, I have to usei18n_taxonomy_term_name()in order to show the translated label.Please note that I am using localized terms, not translated. Might that be the issue?
Comment #14
finex commentedI'm using a "Localized" vocabulary with Facet API -dev (2012-11-02): terms are not translated on faceted search blocks.
@Martijn Houtman: where did you use
i18n_taxonomy_term_name()?P.S: this issue affects "Search API" too ( http://drupal.org/node/1775678 )
Comment #15
gaëlgLocalized terms problem is addressed at #1340858: Language in entity_label()
Comment #16
martijn houtman commentedI edited facetapi/facetapi.callbacks.inc like this:
Comment #17
pirex360 commentedI tried to apply #16...but i dont see my taxonomy terms translated ? I must do something more ?
facetapi support taxonomy translation, out of the box ?
Comment #18
cossimo commented@pirex360 -- Don't know if you've solved this problem yet, but per http://drupal.org/node/1865604, updating to the latest dev of the Title module solved this problem for me.
Comment #19
martijn houtman commentedCossimo, nice catch, it was indeed the title module interfering. My code in #16 is no longer needed.
Comment #20
pcoucke commentedI still needed the fix from #16 in order to have translated terms. I don't have the Title module installed.
Comment #21
brainHax commentedDo you still have to translate each terms from translate interface?
Comment #22
joinso commentedHi!
I confirm that #16 works.
Regards,
JOINSO