You are here

function i18ntaxonomy_preprocess_forums in Internationalization 6

Translate forum page.

File

i18ntaxonomy/i18ntaxonomy.module, line 1060
i18n taxonomy module

Code

function i18ntaxonomy_preprocess_forums(&$variables) {
  $vid = variable_get('forum_nav_vocabulary', '');
  if (i18ntaxonomy_vocabulary($vid)) {
    if (isset($variables['links']['forum'])) {
      $variables['links']['forum']['title'] = i18nstrings('nodetype:type:forum:post_button', 'Post new Forum topic');
    }

    // This one is from advanced forum, http://drupal.org/project/advanced_forum
    if ($variables['forum_description']) {
      $variables['forum_description'] = i18nstrings('taxonomy:term:' . $variables['tid'] . ':description', $variables['forum_description']);
    }
    $vocabulary = taxonomy_vocabulary_load($vid);

    // Translate the page title.
    $title = !empty($vocabulary->name) ? i18ntaxonomy_translate_vocabulary_name($vocabulary) : '';
    drupal_set_title($title);

    // Translate the breadcrumb.
    $breadcrumb = array();
    $breadcrumb[] = l(t('Home'), NULL);
    $breadcrumb[] = l($title, 'forum');
    drupal_set_breadcrumb($breadcrumb);
  }
}