You are here

function _content_taxonomy_localize_term in Content Taxonomy 6

Same name and namespace in other branches
  1. 6.2 content_taxonomy.module \_content_taxonomy_localize_term()

Localize a term by replacing its name attribute with its localized version for the current language.

Parameters

$term: The term to localize.

This is based on i18ntaxonomy_localize_terms(), but with less overhead.

5 calls to _content_taxonomy_localize_term()
content_taxonomy_allowed_values in ./content_taxonomy.module
Called by content_allowed_values to create the $options array for the content_taxonomy_options
content_taxonomy_allowed_values_groups in ./content_taxonomy.module
Creating Opt Groups for content_taxonomy_options
theme_content_taxonomy_formatter_default in ./content_taxonomy.module
Theme function for 'default' text field formatter.
theme_content_taxonomy_formatter_link in ./content_taxonomy.module
Theme function for 'link' text field formatter.
_content_taxonomy_get_all_terms in ./content_taxonomy.module
Helper functions that returns all terms group by their vocabulary

File

./content_taxonomy.module, line 475
Defines a field type for referencing a taxonomy term.

Code

function _content_taxonomy_localize_term(&$term) {

  // If this term's vocabulary supports localization.
  if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary($term->vid) == I18N_TAXONOMY_LOCALIZE) {
    $term->name = tt("taxonomy:term:{$term->tid}:name", $term->name);
  }
}