Needs review
Project:
Cumulus
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Dec 2008 at 14:36 UTC
Updated:
3 Apr 2011 at 17:44 UTC
Based on this patch for Tagadelic :
Tagadelic : http://drupal.org/node/339945
case 'view':
// Tagadelic API
$tags = tagadelic_get_weighted_tags(array(variable_get('cumulus_vid', 1)), variable_get('cumulus_tagadelic_step', 6), variable_get('cumulus_tagadelic_limit', 24));
$tags = tagadelic_sort_tags($tags);
+ if (module_exists("i18ntaxonomy")) {
+ i18ntaxonomy_localize_terms($tags);
+ }
// theme tags for cumulus: tags tag, font size, link, encode
$tags_formatted_flash = theme('cumulus_weighted', $tags);
Comments
Comment #1
broonHi there,
I was in need of this functionality, too, since we have a single vocabulary containing terms for all languages. In order to filter the terms to be shown depending on currently viewed language I did the following changes.
cumulus.module, around line 59 (Version info: cumulus.module,v 1.1.2.10 2009/04/14 09:04:58 lut4rp Exp) for sending current language as parameter:
tagadelic.module, around line 211 (Version info: tagadelic.module,v 1.40.2.4 2008/12/31 11:35:44 ber Exp) for getting the language parameter (defaulting to 'en') and including it by altering database query:
Comment #2
nchase commentedthanks for your contribution. Is this working with the "Localize terms" option? thanks
Comment #3
broonActually, I didn't try that. But I guess it wouldn't work, since localicable terms have no language assigned to them. This is a flaw in my patch, which I noticed because I had some terms which weren't translated because the term is the same in both languages used. So I changed in tagadelic.module following line
to
Now the not translated terms showed up, too, and now it should also work with localizable terms.
Comment #4
nchase commentedthanks for your contribution. Doesn't work with localizable terms...
Comment #5
broonHi snicers,
in cumulus.module, function cumulus_block(), around line 62 it should read:
These lines fetch the tags via tagadelic (and sort them). Right after that you could try to put the following snippet (which was posted by thread starter) if i18n module is installed:
For some reason I couldn't get this to work properly, however you could try to use built-in translation service if all terms were translated through the translation interface:
sin
Comment #6
agrigor1 commentedAre we going to see a new version with the option of localized terms being shown inside cumulus cloud?
Comment #7
broonWell, I'm not the maintainer of this module, neither do I have ever contributed a patch or a module myself. I'm just a php coder and are now working with Drupal for four month. Within that time I already coded several custom modules for clients and tweaked some modules to meet customers needs, but nothing of that was suitable for the community (either to specific or not totally done yet).
Additionally, I don't have knowledge of all helpful modules and how to integrate or utilize them in other modules, so my learning curve is still steep. :)
Comment #8
nchase commented@ sin.star thank you! Your code in #5 is working fine. Thank you!
Comment #9
sinasquax commentedIf you use this patch (http://drupal.org/node/584376) for tagadelic, you will not need anymore to patch cumulus for language support.
Comment #10
mediameriquat commentedI have applied the patch proposed above and cleared all caches to no avail. Cumulus still displays taxonomy items in the default language, without taking in account the current language.
Comment #11
nchase commentedthere was a second idea... to duplicate the module... one for first language , one for second..
Comment #12
gundara commentedcheck out that one, the taxonomy section http://www.eangkasa.com/content/setting-multilingual-site-drupal-interna...
Cumulus shows a cloud depending on the language picked in the language chooser.
Using the option "Per language terms" for taxonomy does anyway make more sense on a linguistic point of view since different languages use different concepts.
Comment #13
fr4nky commentedfunction theme_cumulus_weighted($terms) {
+ if (module_exists("i18ntaxonomy")) {
+ i18ntaxonomy_localize_terms($terms);
+ }
$output = '';
This works if you select "localize terms" in the taxonomy vocabulary.
Comment #14
univac commentedHi fr4nky
hi all,
it does not display localized terms in my case.
I am using v6.x-1.4 i.e. the latest available, with Vocabularies configured with "localize terms".
Any ideas?
Thanks for the nice module.
Comment #15
kingqueenyun commented