This is the second bug that I noticed with Drigg when installed on multi-linguistic sites:

(I'm not sure if it has to do with i18n module or drupal's core Localization module)

The drigg Categories that appear in the top menu section are a Taxonomy vocabulary. There are two ways to translate taxonomy vocabularies:
One is through a module included in i18n pack responsible for translatable taxonomies, in which case a concurrent taxonomy is created and then synchronized with existing taxonomy terms,
(When this is done, ALL categories will be displayed in ALL languages one after the other. i.e. the translations don't replace each other, but are displayed concurrently)

and the second method (albeit a bit hack-ish) is to use Drupal's core Localization module and translate the taxonomy terms as if they were strings
(when it is done this way, nothing changes... no translations appear and the default English categories are displayed, even though the rest of the interface easily switches between languages)

If it helps at all, by comparison, I had absolutely no problem translating the drigg navigation tools (Popular, Upcoming, Archive, newest, top24h, etc etc) or block titles or any other parts of Drigg ... Those parts of drigg are absolutely fine as far as multi-lingiustic settings are concerned.

Comments

mercmobily’s picture

Hi,

There is no way for me to actually debut this... so, I am a little blind.
I have no idea about the problem with the module which is supposed to translate taxonomies.

However, I think I know what the problem is in terms of Drigg.

Please change line 4675 from:

$output.='<li><a '.$selected.' href="'.$link.'" title="'.$terms['lookup'][$tid]['description'].'"><span>'.$terms['lookup'][$tid]['name'].'</span></a>'.$rss_links .'</li>';

Into:

$output.='<li><a '.$selected.' href="'.$link.'" title="'.t($terms['lookup'][$tid]['description']).'"><span>'.t($terms['lookup'][$tid]['name']).'</span></a>'.$rss_links .'</li>';

This will basically get Drigg to pass the taxonomy strings to the localisation function.
It should then be a matter of getting those translated...

Please let me know if this works.

Merc.

drupalina’s picture

tried this line replacement. It works (I'd say this line should definitely be included in version 21 of Drigg), BUT it works partially...

It works only if I follow the second route that I described (doing it through Drupal's core Localization module , rather than i18n module).

So far, I'm gonna go with this... but I'm not sure what that will mean in the long-run when more content is added and how that will reflect on taxonomy behaviour (my suspicion is that it should be just fine).

But the only obvious remaining drawback with this solution is that... The language preference still doesn't hold when I click on the categories -- i.e. if I click on "Rouge", while in French (for example) it will bring me to the English "Red" section (with all of the interface changed back to English), which makes it impossible to navigate between categories and Popular/Upcoming/Archive/top24h/etc
Though I'm not a coder, I suspect this has to do with the way that Drigg aliases are written:
right now clicking on "Rouge" category will go to example.com/Red rather than example.com/fr/Rouge or example.com/fr/Red
(and the same thing applies to the navigation -- i.e. if French is set as the language, it will go to example.com/upcoming/newest rather than example.com/fr/upcoming newest )

---------
This handbook page describes how to translate taxonomies properly through i18n http://drupal.org/node/133999 , however, my method of translating the interface was more of what mr.j describes in the comments of that page. And for now I think I'm gonna go with that.

When I do the taxonomy translations through proper i18n route as described in the main article of that handbook page, the Drigg categories in ALL languages will still appear one after the other -- i.e. Red, Rojo Rouge, Blue, Ble, Verde, Green, Azul (even when I set the i18n multilingual system settings to "Display only current language, and no other language".
Furthermore, the Categories block too displays all categories in ALL languages.

mercmobily’s picture

Hi,

OK, let's do one thing at a time.
I am most interested at sorting out at least one route.
The part that concerns me the most is:

---------------------------------
But the only obvious remaining drawback with this solution is that... The language preference still doesn't hold when I click on the categories -- i.e. if I click on "Rouge", while in French (for example) it will bring me to the English "Red" section (with all of the interface changed back to English), which makes it impossible to navigate between categories and Popular/Upcoming/Archive/top24h/etc
Though I'm not a coder, I suspect this has to do with the way that Drigg aliases are written:
right now clicking on "Rouge" category will go to example.com/Red rather than example.com/fr/Rouge or example.com/fr/Red
(and the same thing applies to the navi
------------------------------

Let's talk about this particular problem: which module are you using to manage the multi-language site? In this module, the URL determines the translation strings. Right? (I can only assume that's the case). So www.example.com/en/Red should show a page in English, and www.example.com/fr/Red should show the french version. Right? I have never actually done internationalisation, although I do make sure to have the t() there.

Please provide extra info! It would be great if you could also provide a link to the public site (in 2 languages, so that I can "get it")

Merc.

P.S. to the accidental reader:
URLs will _never_ be translated. So, unfortunately, the categories will always stay in the same main language. Changing this would require am major rewrite. Requests to change the URLs will automatically be marked as "won't fix"!

drupalina’s picture

ok... let's start with priority 1 problem and build from there.

which module are you using to manage the multi-language site?

Drupal's core Localization module is enough to translate the interface into another language. (Roughly speaking multy-language site can *almost* run using just this, but it is enough only to translate strings) But if the site is running on more than 1 language simultaneously and needs synchronization between interface, menu, taxonomies, nodes, profiles, etc -- that's what i18n (internationalization) pack of modules is for. i18n builds on top of Localization. But the simple distinction between example.com (whereby English is the default) and example.com/fr or example.com/ru (to the best of my knowledge) is managed by the Localization module, because that is where the languages are defined.

In this module, [Localization] the URL determines the translation strings. Right?

That's right.

So www.example.com/en/Red should show a page in English, and www.example.com/fr/Red should show the french version. Right?

That's right. AND if you set "en" as your default language then it will automatically be www.example.com/Red (just as good as example.com/en/Red) ... while all other languages will be www.example.com/fr/Red or www.example.com/ru/Red (and this is the part that doesn't work with drigg)
And the cool thing with Localization is that there's no need to specify the language in primary links or any other links (you don't need to specify fr/drigg_home .. all that you need is drigg_home) and the Localization takes care of the rest -- so, if you're currently browsing in French and you click on the the link that points at drigg_home you will be brought to www.example.com/fr/drigg_home (by the way, if it helps, I need to mention that drigg_home link works in multiple languages like a charm)

I hope this info contains some hints as to where the glitch could be.

It would be great if you could also provide a link to the public site (in 2 languages, so that I can "get it")

I don't want to mention my live site in the forum, but I wrote an e-mail to you few days back (about that Pingback problem) ... I mentioned the URL there. If you want I can e-mail the URL again.

mercmobily’s picture

Hi,

I think I know what the problem is.
Of course, it's my own stupidity once again.

Fixing it now...

Sorry about this.

Merc.

drupalina’s picture

I wonder if there's any progress since post #5.
I've upgraded to Drigg 21, but these issues still persist.

Thanks!

mercmobily’s picture

Hi,

It's next in my todo list.
It's a freaky thing to change in Drigg, since getting it wrong will basically break _everything_...

Merc.

mercmobily’s picture

Status: Active » Fixed

Hi,

This is now fixed, but man, it was a tough call.
I am gonna release Drigg 22 now. However... please please please test it. Especially the menu system, which was basically broken before.

The problem of the taxonomy translation... I am honestly not sure. I don't think there's much I can do about it.

Merc.

drupalina’s picture

I can't see Drigg 22. I'm assuming it's 23 now.

I'll test it right away.

Please tell me... did you make any modifications outside drigg.module file??? Can I overwrite only that file and test it like that? or do I need to overwrite the entire drigg directory?

Thanks

drupalina’s picture

I've tested on my sandbox site by simply overwriting drigg.module file of version 21 with the drigg.module file from the version 23 folder.

Preliminary impressions: seems to work fine. (category navigations switch laguages and stay with those languages as one browses through Promoted, Upcoming, Archive, top24h, etc)

Please let me know if you did any more modifications outside of the drigg.module file (between 21 and 23) ... and if yes then I'll test the whole version 23 folder on my production site.

drupalina’s picture

Status: Fixed » Active

sorry,
forgot to change it to "active" to catch your attention

mercmobily’s picture

Hi,

WOW... it works!
No extra modifications. So, I think we are good to go... moving this to "fixed", reopen it if there are more problems!

Merc.

drupalina’s picture

Status: Active » Fixed

Yep... I'm over the moon myself (it's almost unreal)

I also tested on my live production site by overwriting the entire drigg folder -- and it (drigg 23) works!!!... LIKE A CLOCKWORK... flawlessly!!! Perfection!

Thank you, Merc!!!

mercmobily’s picture

:-D

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)
drupalina’s picture

Version: 5.x-1.20 » 5.x-1.31
Priority: Normal » Critical
Status: Closed (fixed) » Active

OK... here's a small but critical remnant of the above problem.

Say I have a bi-lingual site: English as a default, and there's also the Russian language.
If I switch to Russian and surf around the categories everything is fine and remains in Russian. But if I click on "All" (the link that is there before all other categories), then the site switches back to the default language (English).

mercmobily’s picture

Status: Active » Fixed

Hi,

OK, found out that this is likely to be a bug with i18n. This is really unrelated to this issue ("Categories will appear one after the other") and it's not really a bug in Drigg. So, I reported the issue to the i18n guys http://drupal.org/node/253784 -- closing this issue here.

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)