function _entity_translation_taxonomy_label in Entity Translation 7
Returns a translated label for the specified taxonomy term.
@internal This is supposed to be used only by the ET taxonomy integration code, as it might be removed/replaced in any moment of the ET lifecycle.
Parameters
object $term: A taxonomy term object.
string $langcode: The language the label should be translated in.
Return value
string The translated taxonomy term label.
3 calls to _entity_translation_taxonomy_label()
- entity_translation_field_widget_taxonomy_autocomplete_form_alter in ./
entity_translation.taxonomy.inc - Implements hook_field_widget_WIDGET_TYPE_form_alter().
- entity_translation_taxonomy_autocomplete_validate in ./
entity_translation.taxonomy.inc - Form element validate handler for taxonomy term autocomplete element.
- entity_translation_taxonomy_term_autocomplete in ./
entity_translation.taxonomy.inc - Entity translation taxonomy autocomplete callback.
File
- ./
entity_translation.taxonomy.inc, line 114 - The taxonomy specific translation functions and hook implementations.
Code
function _entity_translation_taxonomy_label($term, $langcode) {
$entity_type = 'taxonomy_term';
if (function_exists('title_entity_label')) {
$label = title_entity_label($term, $entity_type, $langcode);
}
else {
$label = entity_label($entity_type, $term);
}
return (string) $label;
}