@@ -75,7 +75,7 @@ function i18n_menu_menu_alter(&$items) {
75
75
*
76
76
* @see theme_menu_admin_overview()
77
77
*/
78
- function i18n_menu_preprocess_menu_admin_overview(&$variables) {
78
+ function i18n_menu_preprocess_menu_admin_overview(array &$variables) {
79
79
$base_context = "menu:menu:{$variables['name']}:";
80
80
$variables['title'] = i18n_string($base_context . 'title', $variables['title']);
81
81
$variables['description'] = i18n_string($base_context . 'description', $variables['description']);
@@ -89,23 +89,6 @@ function i18n_menu_menu_overview_title($menu) {
89
89
return i18n_string($context, $menu['title']);
90
90
}
91
91
92
- /**
93
- * Implements hook_block_view().
94
- */
95
- function i18n_menu_block_view_alter(&$data, $block) {
96
- if (($block->module == 'menu' || $block->module == 'system') && (i18n_menu_mode($block->delta) & I18N_MODE_MULTIPLE)) {
97
- $menus = menu_get_menus();
98
- if (isset($menus[$block->delta])) {
99
- if (!empty($data['title'])) {
100
- $data['title'] = i18n_string_plain(
101
- array('menu', 'menu', $block->delta, 'title'),
102
- $menus[$block->delta]
103
- );
104
- }
105
- }
106
- }
107
- }
108
-
109
92
/**
110
93
* Implements hook_i18n_translate_path().
111
94
*/
@@ -592,7 +575,7 @@ function _i18n_menu_link_check_alter($link) {
592
575
* @return bool
593
576
* Returns TRUE if link is localizable.
594
577
*/
595
- function _i18n_menu_link_is_localizable($link, $check_strings = FALSE) {
578
+ function _i18n_menu_link_is_localizable(array $link, $check_strings = FALSE) {
596
579
return !empty($link['customized']) && !i18n_object_langcode($link, FALSE, 'langcode') && i18n_menu_mode($link['menu_name'], I18N_MODE_LOCALIZE) &&
597
580
(!$check_strings || _i18n_menu_link_localizable_properties($link));
598
581
}
@@ -789,6 +772,23 @@ function i18n_menu_form_menu_overview_form_alter(&$form, &$form_state) {
789
772
}
790
773
}
791
774
775
+ /**
776
+ * Implements hook_form_FORM_ID_alter().
777
+ *
778
+ * FORM_ID = i18n_string_translate_page_overview_form.
779
+ * Add help text to menu translation overview pages, e.g.
780
+ * "admin/structure/menu/manage/main-menu/translate".
781
+ */
782
+ function i18n_menu_form_i18n_string_translate_page_overview_form_alter(&$form, &$form_state) {
783
+ $form['help'] = array(
784
+ '#type' => 'help',
785
+ '#markup' => t('Provides a translation for the menu title to be used in administrative contexts. If a menu title is being displayed for a block in a layout, translate it on the <a href="!url">User interface translation</a> page.', array(
786
+ '!url' => url('admin/config/regional/translate'),
787
+ )),
788
+ '#weight' => -1,
789
+ );
790
+ }
791
+
792
792
/**
793
793
* Check normal path.
794
794
*
0 commit comments