function i18n_taxonomy_i18n_object_info in Internationalization 7
Implements hook_i18n_object_info().
File
- i18n_taxonomy/
i18n_taxonomy.i18n.inc, line 10 - Internationalization (i18n) hooks
Code
function i18n_taxonomy_i18n_object_info() {
$info['taxonomy_term'] = array(
'title' => t('Taxonomy term'),
'class' => 'i18n_taxonomy_term',
'entity' => 'taxonomy_term',
'key' => 'tid',
'placeholders' => array(
'%taxonomy_term' => 'tid',
),
// Auto generate edit path
'edit path' => 'taxonomy/term/%taxonomy_term/edit',
// Auto-generate translate tab
'translate tab' => 'taxonomy/term/%taxonomy_term/translate',
'translation set' => TRUE,
'string translation' => array(
'textgroup' => 'taxonomy',
'type' => 'term',
'properties' => array(
'name' => t('Name'),
'description' => array(
'title' => t('Description'),
'format' => 'format',
),
),
),
);
$info['taxonomy_vocabulary'] = array(
'title' => t('Vocabulary'),
'entity' => 'taxonomy_vocabulary',
'key' => 'vid',
'placeholders' => array(
'%taxonomy_vocabulary_machine_name' => 'machine_name',
),
// Auto generate edit path
'edit path' => 'admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/edit',
// Auto-generate translate tab
'translate tab' => 'admin/structure/taxonomy/%taxonomy_vocabulary_machine_name/translate',
// We can easily list all these objects
'list callback' => 'taxonomy_get_vocabularies',
// Metadata for string translation
'string translation' => array(
'textgroup' => 'taxonomy',
'type' => 'vocabulary',
'properties' => array(
'name' => t('Name'),
'description' => t('Description'),
),
),
'translation container' => array(
'name' => t('vocabulary'),
'item type' => 'taxonomy_term',
'item name' => t('terms'),
'options' => array(
I18N_MODE_NONE,
I18N_MODE_LOCALIZE,
I18N_MODE_TRANSLATE,
I18N_MODE_LANGUAGE,
),
),
);
return $info;
}