Issue #1157456 by skilip: Changed Remove the 'Language neutral' option when translat...
authorJose Reyero
Fri, 20 May 2011 17:13:22 +0000 (19:13 +0200)
committerJose Reyero
Fri, 20 May 2011 17:13:22 +0000 (19:13 +0200)
i18n_menu/i18n_menu.module
i18n_taxonomy/i18n_taxonomy.module
i18n_translation/i18n_translation.module

index a1693a4..958e248 100644 (file)
@@ -596,9 +596,6 @@ function i18n_menu_form_menu_edit_menu_alter(&$form, &$form_state) {
   $langcode = $menu && isset($menu['language']) ? $menu['language'] : LANGUAGE_NONE;
 
   $form += i18n_translation_mode_element('menu', $i18n_mode, $langcode);
-
-  $form['i18n_translation']['language']['#options'][LANGUAGE_NONE] = t('- Select a language -');
-  $form['i18n_translation']['language']['#required'] = TRUE;
 }
 
 /**
index b848863..01973a7 100644 (file)
@@ -697,9 +697,6 @@ function i18n_taxonomy_form_taxonomy_form_vocabulary_alter(&$form, &$form_state)
     }
     $form['#validate'][] = 'i18n_taxonomy_form_vocabulary_validate';
     $form['#submit'][] = 'i18n_taxonomy_form_vocabulary_submit';
-
-    $form['i18n_translation']['language']['#options'][LANGUAGE_NONE] = t('- Select a language -');
-    $form['i18n_translation']['language']['#required'] = TRUE;
   }
 }
 
index 026246b..15d5def 100644 (file)
@@ -112,10 +112,14 @@ function i18n_translation_mode_element($object_type, $i18n_mode = I18N_MODE_NONE
   $form['i18n_translation']['language'] = array(
     '#default_value' => $langcode ? $langcode : LANGUAGE_NONE,
     '#description' => t('Predefined language. If set, it will apply to all items.'),
+    '#required' => TRUE,
     '#states' => array(
       'visible' => array('input[name="i18n_mode"]' => array('value' => (string)I18N_MODE_LANGUAGE)),
     ),
   ) + i18n_element_language_select();
+
+  // The option value 'Language neutral' makes no sense here.
+  $form['i18n_translation']['language']['#options'][LANGUAGE_NONE] = t('- Select a language -');
   return $form;
 }