function i18n_menu_localize_elements in Internationalization 7
Localize menu renderable array
File
- i18n_menu/
i18n_menu.module, line 423 - Internationalization (i18n) submodule: Menu translation.
Code
function i18n_menu_localize_elements(&$elements) {
foreach (element_children($elements) as $mlid) {
$elements[$mlid]['#title'] = i18n_string(array(
'menu',
'item',
$mlid,
'title',
), $elements[$mlid]['#title']);
if (!empty($tree[$mlid]['#localized_options']['attributes']['title'])) {
$elements[$mlid]['#localized_options']['attributes']['title'] = i18n_string(array(
'menu',
'item',
$mlid,
'description',
), $tree[$mlid]['#localized_options']['attributes']['title']);
}
i18n_menu_localize_elements($elements[$mlid]);
}
}