function i18n_menu_i18n_object_info in Internationalization 7
Implements hook_i18n_object_info().
File
- i18n_menu/
i18n_menu.i18n.inc, line 10 - Internationalization (i18n) hooks
Code
function i18n_menu_i18n_object_info() {
$info['menu'] = array(
'title' => t('Menu'),
'key' => 'menu_name',
'load callback' => 'menu_load',
'base path' => 'admin/structure/menu/manage',
'placeholders' => array(
'%menu' => 'menu_name',
),
'edit path' => 'admin/structure/menu/manage/%menu/edit',
// Auto-generate translate tab.
'translate tab' => 'admin/structure/menu/manage/%menu/translate',
// We can easily list all these objects
'list callback' => 'menu_load_all',
// Metadata for string translation
'string translation' => array(
'textgroup' => 'menu',
'type' => 'menu',
'properties' => array(
'title' => t('Title'),
'description' => t('Description'),
),
),
'translation container' => array(
'name' => t('menu'),
'item type' => 'menu_link',
'item name' => t('menu items'),
'options' => array(
I18N_MODE_NONE,
I18N_MODE_MULTIPLE,
I18N_MODE_LANGUAGE,
),
),
);
$info['menu_link'] = array(
'title' => t('Menu link'),
'class' => 'i18n_menu_link',
'key' => 'mlid',
'load callback' => 'menu_link_load',
'base path' => 'admin/structure/menu/item',
'edit path' => 'admin/structure/menu/item/%menu_link/edit',
// Auto-generate translate tab
'translate tab' => 'admin/structure/menu/item/%menu_link/translate',
'placeholders' => array(
'%menu_link' => 'mlid',
'%menu' => 'menu_name',
),
'string translation' => array(
'textgroup' => 'menu',
'type' => 'item',
'properties' => array(
'title' => array(
'title' => t('Title'),
'field' => 'link_title',
),
'description' => array(
'title' => t('Description'),
'field' => 'options.attributes.title',
),
),
),
'translation set' => TRUE,
);
return $info;
}