diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php index dfa1c3f..5302064 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermFormController.php @@ -41,12 +41,13 @@ class TermFormController extends EntityFormController { '#format' => $term->format, '#weight' => 0, ); - + $language_configuration = module_invoke('language', 'get_configuration', 'vocabulary', $vocabulary->machine_name); $form['langcode'] = array( '#type' => 'language_select', '#title' => t('Language'), '#languages' => LANGUAGE_ALL, '#default_value' => $term->langcode, + '#access' => !is_null($language_configuration['language_hidden']) && !$language_configuration['language_hidden'], ); $form['vocabulary_machine_name'] = array( diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index 163c0e7..be6914f 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -108,7 +108,6 @@ function taxonomy_vocabulary_add() { $vocabulary = entity_create('taxonomy_vocabulary', array( // Default the new vocabulary to the site's default language. This is the // most likely default value until we have better flexible settings. - // @todo See http://drupal.org/node/258785 and followups. 'langcode' => language_default()->langcode, )); return entity_get_form($vocabulary); @@ -522,7 +521,8 @@ function theme_taxonomy_overview_terms($variables) { * Returns a rendered edit form to create a new term associated to the given vocabulary. */ function taxonomy_term_add($vocabulary) { - $term = entity_create('taxonomy_term', array('vid' => $vocabulary->vid, 'vocabulary_machine_name' => $vocabulary->machine_name)); + $lang_code = module_invoke('language', 'get_default_langcode', 'vocabulary', $vocabulary->machine_name); + $term = entity_create('taxonomy_term', array('vid' => $vocabulary->vid, 'vocabulary_machine_name' => $vocabulary->machine_name, 'langcode' => $lang_code)); return entity_get_form($term); }