Taxonomy terms are not translated or localized in tagclouds. I suggest adding i18n support.

The i18n API can be used for this task, useful methods:

  if (module_exists('i18n_taxonomy')) {
    $language = i18n_language();
  }

  if (module_exists('i18n_taxonomy')) {
    $term_name = i18n_taxonomy_term_name($term, $language);
  } else {
    $term_name = $term->name;
  }

There are many modules using i18n that can be used as examples.

CommentFileSizeAuthor
#2 i18n_1696498_2.patch7.04 KBscito

Comments

scito’s picture

Issue summary: View changes

Improve code example

MGParisi’s picture

Can you create a .PATCH?

scito’s picture

Issue tags: +i18n compatibility
StatusFileSize
new7.04 KB

I've written a patch. I haven't tested extensively. My basic use case works.

Further, I've removed trailing whitespace.

scito’s picture

Status: Active » Needs review
scito’s picture

I've filed an issue to i18n in order to add *_description methods: #1704658: Provide taxonomy description translation, unfiltered name and description..

MGParisi’s picture

Scito, would you like to be a co-maintainer on this project to maintain the translations? Also have you tested the dev version, I would like to release 1.5 before I move onto translations, but I have gotten no feedback on the Dev versions stability.

scito’s picture

Actually, I'm using the current TagClouds dev version including this i18n patch on my production site. For me it's working smooth. No problems detected so far. (However, my site is only a low traffic blog.)

Co-maintainer sounds great! Do you mean I should maintain the i18n stuff of TagClouds?

I think in general it's not a big deal, except new major Drupal releases.

Do you know the procedure for applying for co-maintainership?

MGParisi’s picture

Do you have git access? If not you have to put in an application in the Webmasters Queue for it, or talk on IRC about it.

I can add you, but lets release the current codebase as 1.5 and then add i8n support for 1.6 branch.

MGParisi’s picture

Added you as a co-maintainer.

scito’s picture

I've setup git for Drupal. Should I commit the patch?
Should I wait until the critical bug #1705418: New Tags Not Appearing in Cloud is resolved?

MGParisi’s picture

I dont have time to resolve that bug, right now. Its on a priority list but I have to get at it. Maybe I will look at it tomorrow.

MGParisi’s picture

Wait for new dev version, I think its solved

MGParisi’s picture

The New Dev Is Up!

MGParisi’s picture

Want to apply the taxonomy fixes to 1.6 and make it dev?

scito’s picture

OK, I'll do commit it soon.

scito’s picture

Status: Needs review » Fixed

I've cleaned trailing whitespace before committing this i18n patch since my editor always cleans trailing whitespace.

I had to merge my patch with the latest changes. Some lines are affected by both patches.

Finally, committed and pushed to 7.x-1.x.

I hope everything went well in first Drupal commit.

BTW: I've found another issue: #1757746: Warnings and notices if a passed vocabulary vid does not exist

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Improve code example text

  • Commit b7958be on 7.x-1.x, 8.x-1.x by scito:
    Issue #1696498 by scito: Add i18n support for taxonomy terms