I just created some translations for the taxonomy (name / description) on the forum vocabulary, but they won't show up in the general forum pages where the user can choose a particular forum to display. The names and descriptions stay on default language.

I looked into the theming functions of the forum module and those "name"s and "description"s are not surrounded by t() function when printign them out. My question is, should the i8ntaxonomy already have translated them when forum is processing them, or do I have to alter the forum-theming-functions myself?

see http://api.drupal.org/api/file/modules/forum/forum-list.tpl.php/6/source

Comments

japanitrat’s picture

Status: Active » Postponed (maintainer needs more info)

hmm, as intermediate workaround i am now hooking into template_preprocess_forum_list in my template.php file of the theme as in:

function phptemplate_preprocess_forum_list(&$variables){
  if (module_exists('i18ntaxonomy')) 
    $variables['forums'] = i18ntaxonomy_localize_terms($variables['forums'], array('name', 'description'));
}

I know, this is a bad solution, since it's on template-level and only working for the forum-listing (and not for breadcrumbs for instance).

Any ideas on a better implementation in order to translate the taxonomy more near the core?

PS:
idk, if this is intended, but i18ntaxonomy_localize_terms replaces descriptions with names per default as in line 6 below (in the 6.x beta1 as well as the dev version):

function i18ntaxonomy_localize_terms($terms, $fields = array('name')) {
  $localize = i18ntaxonomy_vocabulary(NULL, I18N_TAXONOMY_LOCALIZE);
  foreach ($terms as $index => $term) {
    if (in_array($term->vid, $localize)) {
      foreach ($fields as $property) {
        $terms[$index]->$property = tt("taxonomy:term:$term->tid:$property", $term->name);
      }
    }
  }
  return $terms;
}

so i changed $term->name to $term->$property, to get the proper default string, if no translation has been found.

toemaz’s picture

Version: 6.x-1.0-beta1 » 6.x-1.0-beta3

I have the exact same problem.

- Installed i18n 6.x-1.0-beta3 and enabled multilingual taxonomy
- Set the forum vocab on the second i18n option: translate name and description for each term
- Translated all the terms

For any language other than the default (en in my case), the forum terms & descriptions remain in the default language.

However, when adding a new forum topic via /node/add/forum/0 , the terms in the select box to add the new topic to the right forum are translated. So that seems to work.

I presume the solution presented above will work. However, I think it's odd that this is a Drupal core issue.

toemaz’s picture

Status: Postponed (maintainer needs more info) » Active

I'm really starting to think this is a bug in the core forum module, rather than i18n module. Should we move?

See: http://api.drupal.org/api/file/modules/forum/forum.module/6/source

jose reyero’s picture

Category: support » feature

The problem is Drupal 6 core doesn't handle multilingual taxonomies (Forum relies on taxonomies) nor user defined string translation.

So yes, this is a desirable feature to be added into i18ntaxonomy. Possibly we'll need a replacement page for the Forum landing pages.

jaydublu’s picture

I eventually managed to get a hooking into template_preprocess_forum_list in template.php file of my theme. This is working for the content of the forum_list table.

However, I can't figure our how to correct the page title on forum_topic_list page which still shows the default language.

On a topic page curiously, although the crumbtrail is in default language the link to the parent forum within the main page is translated.

Since the forum module is core, I agree that the best place for the fix is within the i18n module.

I'm currently using Drupal 6.9 and Taxonomy translation 6.x-1.0

cronix’s picture

Is there any process on this issue? I am experiencing exactly the same issue. My taxonomy menu is also not translated. Are these two related?

cronix’s picture

Is there any progress on this issue? I am experiencing exactly the same issue. My taxonomy menu is also not translated. Are these two related?

mikhailian’s picture

japanitrat , thank you for the hack! This was really helpful.

boran’s picture

See also http://drupal.org/node/584356, a thread I'd started before finding this one.

jose reyero’s picture

Component: Experimental modules » Blocks
Status: Active » Closed (won't fix)