Hi,
I went through all the different threads about this issue but found no solution. I translated my terms (default language: German, vocabulary: localizabled, no real translation) on translation interface to English by Internationalization/ Taxonomy Translate and everything works fine. BUT: in exposed filtes the terms are still not translated.
Here are the stats of my installation.
Drupal 6.19
Internationalisation 6.x-1.5 (Taxonomy Translation activated)
Internationalization Views 6.x-2.0 (with applied patch of http://drupal.org/node/346028#comment-2769734)
I also tried the lates dev version of Internationalization Views but nothing changed (yes, I cleared ALL caches several times). Can anyone help me with this issue?
Greez,
Tobias
Comments
Comment #1
udane CreditAttribution: udane commentedI have the same problem. Does anyone have the solution?
Thanks!
Comment #2
miaoulafrite CreditAttribution: miaoulafrite commented+1
Comment #3
Bilmar CreditAttribution: Bilmar commentedsubscribing - also interested in being able to search the translated term in autocomplete exposed filters
Comment #4
GN CreditAttribution: GN commentedI have the same problem - an i18n issue #295315: Views: taxonomy terms shown in dropdown lists of exposed filters are not translated was posted two years ago, and it's still unsolved for the current versions of i18n and Views.
As a workaround, it's possible to add a Content Taxonomy field and expose it in your filter instead of the taxonomy terms. In this case, term names in dropdown lists are properly translated.
However, it does not work well when you need to group items via Argument Summary (i.e. when you add "Taxonomy: Term" or "Content: CCK-Term" as an Argument and set "Action to take if argument is not present" to "Summary"). With Taxonomy, term names in Summary are not translated (like with exposed filters); when you try to use a Content Taxonomy field instead of the taxonomy terms, Summary displays its integer values, i.e. term id's (tid) instead of their names. (See #973624: Argument Term ID not translated when if not present showing a summary of terms.).
Comment #5
bibo CreditAttribution: bibo commentedsubscribe
Comment #6
selinav CreditAttribution: selinav commented+1
Comment #7
pandersb CreditAttribution: pandersb commentedThis also stumped me and I found a way using the template_preprocess_views_exposed_form function in Views (6.x-2.12) theme.inc in the theme folder.
I don't think you need i18nviews module for this fix since your taxonomy terms will come up as "Built-in interface" in the translate interface search. Add this to your template file, clear your cache, and refresh your language strings. Do a search and translate. It should show up in your form translated.
Comment #8
selinav CreditAttribution: selinav commented#7, thank you for your code, if the default language is not english but french for example it doesn't work, but I have found the solution.
Replace
Comment #9
micheleannj CreditAttribution: micheleannj commentedMy default language is French and I made the change you suggested, but I'm still only seeing English terms.
Should the terms be localized? I'm reading conflicting things as to how the vocabulary should be configured....
Thanks,
m
Comment #10
selinav CreditAttribution: selinav commentedIn my case, they can be translated.
Comment #11
rv0 CreditAttribution: rv0 commented@selinav
thanks, your tt() code saved me a whole bunch of work
Comment #12
christiaan_ CreditAttribution: christiaan_ commentedYou could try this solution - it solved the issue for me.
#1106294: exposed term with depth filter not translated
Comment #13
mkalbere CreditAttribution: mkalbere commented#7 & #8 did it for me ! Thanks !
Comment #14
miaoulafrite CreditAttribution: miaoulafrite commented#7 & #8 are interesting ways but i believe it depends on your taxonomy configuration
it would work in case the vocabulary is set to
Localize terms. Terms are common for all languages, but their name and description may be localized.
or evenSet language to vocabulary. The vocabulary will have a global language and it will only show up for pages in that language.
but if you've chosen, say,
Per language terms. Different terms will be allowed for each language and they can be translated.
, this won't workis that correct?
moreover, the preprocessors are theme functions where it should only render HTML based on operations made by modules.
in the #7, $options are re-generated in the preprocessor, where in the default preprocessor they are not (see default function here)
i believe there should be some hook to make the translation/exposure of terms translatable, whatever taxonomy configuration you've chosen here:
http://drupalcontrib.org/api/drupal/contributions--views--docs--docs.php...
could be that one maybe?
http://drupalcontrib.org/api/drupal/contributions--views--docs--docs.php...
Comment #15
mathieu CreditAttribution: mathieu commentedSadly, #7 does not work if you are using views-6.x-3.x.
Comment #16
mvcas mentioned above, see #1106294: exposed term with depth filter not translated for a solution for views 6.x-2.x and 6.x-3.x.
Comment #17
Amarjit CreditAttribution: Amarjit commentedThanks for this.
#7 + #8 worked on my config.
I added a slight tweak because I had multiple exposed fields.
Versions:
Cheers,
Amarjit
Comment #18
ron_ron CreditAttribution: ron_ron commentedHi,
i ported the code to 7. I know the code is a little bit fuzzy but it works.
The if(isset($option->option)) is necessary because if you use "Show hierarchy in dropdown".
Hope that helps someone too.
Cheers
Comment #19
star-szrClosed #959704: Translation of taxonomy terms in exposed filters as a duplicate of this issue.
Comment #20
Nicolas Bouteille CreditAttribution: Nicolas Bouteille commentedFor Drupal 6.28, Views Translation 6.x-2.0 and Views 6.x-2.16, the code on #7 and #8 was not working anymore.
I had to tweak it a little bit probably because the structure of the form must have change between versions.
Here is the updated code :
Comment #21
heyehren CreditAttribution: heyehren commented#7 and #8 worked for me. i'm using views 6.x-3.0+77-dev.
thank you!
Comment #22
heyehren CreditAttribution: heyehren commentedFor anyone who's looking for a solution, try this: http://drupal.org/node/929368#comment-4025498
Comment #23
JulienThomas CreditAttribution: JulienThomas commentedThanks. It helped me a lot!
I would suggest a small update to avoid warnings:
$options_src = @$form[$info['value']]['#options'] ;
if(!empty($options_src )) {
foreach($options_src as $key=>$option) {
}
Comment #24
malc0mn CreditAttribution: malc0mn commentedI would suggest this change:
Original:
Reason: if you have an optional filter, 'All' will be added to the first item in the list. That case would now end up in the very last translation alteration, generating a 'dirty' i18n string that won't make much sense...
Comment #25
pdelorme CreditAttribution: pdelorme commentedI patched views/modules/taxonomy/views_handler_filter_term_node_tid.inc:136
with
altought it is probably not the nicest way, it works fine.