You are here

function i18n_taxonomy_token_info in Internationalization 7

Implements hook_token_info().

File

i18n_taxonomy/i18n_taxonomy.tokens.inc, line 11
Builds placeholder replacement tokens for taxonomy terms and vocabularies.

Code

function i18n_taxonomy_token_info() {

  // Taxonomy term related variables.
  $term['i18n-name'] = array(
    'name' => t("Name (localized)"),
    'description' => t("The name of the taxonomy term."),
  );
  $term['localized-name'] = array(
    'name' => t("Name in current language"),
    'description' => t("The name of the taxonomy term in current language."),
  );
  $term['i18n-description'] = array(
    'name' => t("Description (localized)"),
    'description' => t("The optional description of the taxonomy term."),
  );

  // Taxonomy vocabulary related variables.
  $vocabulary['i18n-name'] = array(
    'name' => t("Name (localized)"),
    'description' => t("The name of the taxonomy vocabulary."),
  );
  $vocabulary['i18n-description'] = array(
    'name' => t("Description (localized)"),
    'description' => t("The optional description of the taxonomy vocabulary."),
  );

  // Chained tokens for taxonomies
  $term['i18n-vocabulary'] = array(
    'name' => t("Vocabulary (localized)"),
    'description' => t("The vocabulary the taxonomy term belongs to."),
    'type' => 'vocabulary',
  );
  $term['i18n-parent'] = array(
    'name' => t("Parent term (localized)"),
    'description' => t("The parent term of the taxonomy term, if one exists."),
    'type' => 'term',
  );
  return array(
    'tokens' => array(
      'term' => $term,
      'vocabulary' => $vocabulary,
    ),
  );
}