Commit faf98417 authored by Dries's avatar Dries

- Patch #1078980 by plach: language neutral not available when there are disabled languages.

parent 6cb0a702
......@@ -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];
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment