diff options
Diffstat (limited to 'modules/translation')
-rw-r--r-- | modules/translation/translation.module | 2 | ||||
-rw-r--r-- | modules/translation/translation.test | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/modules/translation/translation.module b/modules/translation/translation.module index 1fd12a5ee..697929f66 100644 --- a/modules/translation/translation.module +++ b/modules/translation/translation.module @@ -133,7 +133,7 @@ function translation_form_node_form_alter(&$form, &$form_state) { // might need to distinguish between enabled and disabled languages, hence // we divide them in two option groups. if ($translator_widget) { - $options = array(); + $options = array($groups[1] => array(LANGUAGE_NONE => t('Language neutral'))); $language_list = locale_language_list('name', TRUE); foreach (array(1, 0) as $status) { $group = $groups[$status]; diff --git a/modules/translation/translation.test b/modules/translation/translation.test index c4a04c4cf..fa8c6b63f 100644 --- a/modules/translation/translation.test +++ b/modules/translation/translation.test @@ -125,6 +125,13 @@ class TranslationTestCase extends DrupalWebTestCase { $translation_it = $this->createTranslation($node, $this->randomName(), $this->randomName(), 'it'); $this->assertRaw($translation_it->body['it'][0]['value'], t('Content created in Italian (disabled).')); + // Confirm that language neutral is an option for translators when there are + // disabled languages. + $this->drupalGet('node/add/page'); + $this->assertFieldByXPath('//select[@name="language"]//option', LANGUAGE_NONE, t('Language neutral is available in language selection with disabled languages.')); + $node2 = $this->createPage($this->randomName(), $this->randomName(), LANGUAGE_NONE); + $this->assertRaw($node2->body[LANGUAGE_NONE][0]['value'], t('Language neutral content created with disabled languages available.')); + // Leave just one language enabled and check that the translation overview // page is still accessible. $this->drupalLogin($this->admin_user); |