function i18nmenu_translate_all in Internationalization 5
Same name and namespace in other branches
- 5.3 contrib/i18nmenu.module \i18nmenu_translate_all()
- 5.2 contrib/i18nmenu.module \i18nmenu_translate_all()
1 call to i18nmenu_translate_all()
- i18nmenu_menu in contrib/
i18nmenu.module - Implementation of hook_menu().
File
- contrib/
i18nmenu.module, line 23
Code
function i18nmenu_translate_all() {
global $_menu;
global $user;
global $locale;
$cid = "{$user->uid}:{$locale}";
cache_clear_all($cid, 'cache_menu');
// Translate all user defined meny items
foreach ($_menu['items'] as $mid => $item) {
if ($item['type'] & MENU_CREATED_BY_ADMIN) {
$_menu['items'][$mid]['title'] = t($_menu['items'][$mid]['title']);
}
}
// Update cache
cache_set($cid, 'cache_menu', serialize($_menu), time() + 60 * 60 * 24);
}