When viewing translated taxonomy terms (with the help of i18n and i18n multilangual taxonomy), they are always shown in the page default language. This does not happen when using Garland as theme, but works as expected.

How to reproduce:

  1. Drupal with Taxonomy translation module, Synchronize translations module and their dependencies enabled
  2. Set up a second language
  3. Add taxonomy vocabulary (admin/content/taxonomy/add/vocabulary) with setting Localize terms. Terms are common for all languages, but their name and description may be localized. for blog content type
  4. Create a blog entry
  5. Assign taxonomy term "termA" to blog entry
  6. Translate blog entry to the second available language. Taxonomy term "termA" will be already set
  7. Translate taxonomy term "termA" to "termB"
  8. Switch page to secondary language and open the blog entry.:
  • Garland theme shows taxonomy term "termB"
  • Zero Point theme shows "termA"

Comments

alexbk66-’s picture

This issue is open for two years now, no progress?

The name of the taxonomy isn't translated either.

Problem is in themes' template.php lines 440 - 445

foreach ($terms as $term) {                        // Build vocabulary term items
  $term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
  $term_items .= '<li class="vocab-term">'. $term_link . $term_delimiter .'</li>';
}
if ($taxonomy_format == 'vocab') {                 // Add vocabulary labels if separate
   $output .= '<li class="vocab vocab-'. $vocabulary->vid .'"><span class="vocab-name">'. $vocabulary->name .':</span> <ul class="vocab-list">';

Here's my fix:

foreach ($terms as $term) {                        // Build vocabulary term items 
  //$term_link = l($term->name, taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
  $term_link = l(i18nstrings("taxonomy:term:$term->tid:name", $term->name), taxonomy_term_path($term), array('attributes' => array('rel' => 'tag', 'title' => strip_tags($term->description))));
  $term_items .= '<li class="vocab-term">'. $term_link . $term_delimiter .'</li>';
}
if ($taxonomy_format == 'vocab') {                 // Add vocabulary labels if separate
  $output .= '<li class="vocab vocab-'. $vocabulary->vid .'"><span class="vocab-name">'. t($vocabulary->name) .':</span> <ul class="vocab-list">';

Line 441: i18nstrings("taxonomy:term:$term->tid:name", $term->name)

Should really check if(function_exists('i18nstrings')), otherwise will get an error if i18n module is disabled

Line 445: t($vocabulary->name)

Florian’s picture

Issue summary: View changes
Status: Active » Closed (fixed)