Multi-lingual tag clouds

joe-b - September 29, 2009 - 10:39
Project:Tagadelic
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I know it's old hat to offer a patch against the 5.x module but it is still being used!

If the i18n translation module is installed, tags ought to be shown in the user's selected language. This patch checks if the i18n module is installed and then adds a language check into the tagadelic_get_weighted_tags() function's SQL lookup. The language-specific tag cloud data is then cached per language. Nice and simple.

AttachmentSize
tagadelic.patch1.49 KB

#1

joe-b - September 29, 2009 - 10:44

Of course we need to check for both the i18n and i18ntaxonomy modules - dang! New patch.

AttachmentSize
tagadelic.patch 1.55 KB

#2

Frank Ralf - September 29, 2009 - 12:15
Version:5.x-1.1» 6.x-1.2

I applied this patch successfully against 6.x-1.2. Changing version so users of the current version might test it.

#3

joe-b - September 29, 2009 - 20:29

Thanks, Frank.

#4

Bèr Kessels - October 5, 2009 - 09:20
Version:6.x-1.2» 6.x-1.x-dev

should be tested against -dev

#5

depcam - October 8, 2009 - 21:12

I tried the patch and It didn't worked against 6.x-1.2, I'll try it against 6.x-1.x-dev

#6

srobert72 - October 11, 2009 - 08:39

Very good news !!
I think lot of users wait for such a patch.

#7

depcam - October 13, 2009 - 17:35

I can't make the patch work against 6.x-1.x-dev 2009-Sep-15 which seem to include some sort of language management.

#8

strellman - October 14, 2009 - 10:08

subscribing

#9

Frank Ralf - October 14, 2009 - 11:20

@depcam

Your're right. Line 214 ff. of tagadelic.module uses the $language variable for building the $options string:

<?php
function tagadelic_get_weighted_tags($vids, $steps = 6, $size = 60) {
 
// build the options so we can cache multiple versions
 
global $language;
 
$options = implode('_',$vids) .'_'. $language->language .'_'. $steps .'_'. $size;

...
?>

However, the subsequent SQL query doesn't seem to cater for the language setting.

Have you tried whether 6.x-1.x-dev shows the desired behavior even without this patch?

 
 

Drupal is a registered trademark of Dries Buytaert.