Index: uc_catalog.module =================================================================== --- uc_catalog.module (révision 1741) +++ uc_catalog.module (copie de travail) @@ -225,7 +225,14 @@ } $terms = taxonomy_node_get_terms_by_vocabulary($node, variable_get('uc_catalog_vid', 0)); if (count($terms)) { - $crumbs[] = l(variable_get('uc_catalog_name', t('Catalog')), variable_get('uc_catalog_url', 'catalog')); + //fix by alexku start + //$crumbs[] = l(variable_get('uc_catalog_name', t('Catalog')), variable_get('uc_catalog_url', 'catalog')); + $catalog_name = variable_get('uc_catalog_name', 'Catalog'); + $catalog_id = variable_get('uc_catalog_vid', '1'); + $translated_name = tt("taxonomy:vocabulary:$catalog_id:name", $catalog_name, NULL, FALSE); + $crumbs[] = l($translated_name, variable_get('uc_catalog_url', 'catalog')); + //fix by alexku end + $used_tids = array(); foreach ($terms as $term) { if (!isset($parents[$term->tid])) { @@ -233,6 +240,13 @@ } //drupal_set_message('
'. print_r($parents[$term->tid], TRUE) .'
'); foreach (array_reverse($parents[$term->tid]) as $parent) { + //fix by alexku start + $parent->name = tt("taxonomy:term:$parent->tid:name", $parent->name, NULL, FALSE); + if ($parent->description){ + $parent->description = tt("taxonomy:term:$parent->tid:description", $parent->description, NULL, FALSE); + } + //fix by alexku end + if (!in_array($parent->tid, $used_tids)) { $crumbs[] = l($parent->name, uc_catalog_path($parent)); $used_tids[] = $parent->tid; @@ -431,6 +445,13 @@ // Now, create a structured menu, separate from Drupal's menu. $content = theme('uc_catalog_block', $menu_tree); + //fix by alexku start + //$subject = variable_get('uc_catalog_name', t('Catalog')); + $catalog_name = variable_get('uc_catalog_name', 'Catalog'); + $catalog_id = variable_get('uc_catalog_vid', '1'); + $subject = tt("taxonomy:vocabulary:$catalog_id:name", $catalog_name, NULL, FALSE); + //fix by alexku end + $subject = variable_get('uc_catalog_name', t('Catalog')); if (variable_get('uc_catalog_block_title', FALSE)) { $subject = l($subject, 'catalog'); @@ -805,7 +826,13 @@ $breadcrumbs[] = l(t('Home'), ''); } if ($tid != 0) { - $breadcrumbs[] = l(variable_get('uc_catalog_name', t('Catalog')), 'catalog'); + //fix by alexku start + //$breadcrumbs[] = l(variable_get('uc_catalog_name', t('Catalog')), 'catalog'); + $catalog_name = variable_get('uc_catalog_name', 'Catalog'); + $catalog_id = variable_get('uc_catalog_vid', '1'); + $translated_name = tt("taxonomy:vocabulary:$catalog_id:name", $catalog_name, NULL, FALSE); + $breadcrumbs[] = l($translated_name, variable_get('uc_catalog_url', 'catalog')); + //fix by alexku end } } $parents = taxonomy_get_parents_all($tid); @@ -853,6 +880,15 @@ static $breadcrumb; static $types; + //fix by alexku start + if ($branch->tid) { + $branch->name = tt("taxonomy:term:$branch->tid:name", $branch->name, NULL, TRUE); + if ($branch->description) { + $branch->description = tt("taxonomy:term:$branch->tid:description", $branch->description, NULL, FALSE); + } + } + //fix by alexku end + if (empty($types)) { $types = uc_product_types(); } Index: uc_catalog.pages.inc =================================================================== --- uc_catalog.pages.inc (révision 1741) +++ uc_catalog.pages.inc (copie de travail) @@ -24,12 +24,37 @@ $output = ''; $catalog = uc_catalog_get_page((int)$tid); + + //fix by alexku start + //check if we are on the catalog or on the category page + if (!$catalog->tid) { + //if on catalog page + $catalog->name = tt("taxonomy:vocabulary:$catalog->vid:name", $catalog->name, NULL, FALSE); + if ($catalog->description) { + $catalog->description = tt("taxonomy:vocabulary:$catalog->vid:description", $catalog->description, NULL, FALSE); + } + } + else { + //if on category (term) page + $catalog->name = tt("taxonomy:term:$catalog->tid:name", $catalog->name, NULL, FALSE); + if ($catalog->description) { + $catalog->description = tt("taxonomy:term:$catalog->tid:description", $catalog->description, NULL, FALSE); + } + } + //fix by alexku end + drupal_set_title(check_plain($catalog->name)); drupal_set_breadcrumb(uc_catalog_set_breadcrumb($catalog->tid)); $types = uc_product_types(); $links = array(); $child_list = array(); foreach ($catalog->children as $child) { + //fix by alexku start + $child->name = tt("taxonomy:term:$child->tid:name", $child->name, NULL, FALSE); + if ($child->description) { + $child->description = tt("taxonomy:term:$child->tid:description", $child->description, NULL, FALSE); + } + //fix by alexku end if (!empty($child->nodes)) { $links[] = array('title' => $child->name . (variable_get('uc_catalog_breadcrumb_nodecount', FALSE) ? ' ('. $child->nodes .')' : ''), 'href' => uc_catalog_path($child), 'attributes' => array('rel' => 'tag'),