summaryrefslogtreecommitdiff
path: root/modules/translation
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2011-05-22 09:08:04 -0400
committerDries Buytaert <dries@buytaert.net>2011-05-22 09:08:04 -0400
commitc88f2e0188e48f4c4adfb101d70733a0b27d4685 (patch)
treeb985a727d3da67c543d05ea05d1c5bd7dd4005ed /modules/translation
parent42786ee70e01e1c06139789cf8bbbf701b050c71 (diff)
downloadbrdo-c88f2e0188e48f4c4adfb101d70733a0b27d4685.tar.gz
brdo-c88f2e0188e48f4c4adfb101d70733a0b27d4685.tar.bz2
- Patch #1078980 by plach: language neutral not available when there are disabled languages.
Diffstat (limited to 'modules/translation')
-rw-r--r--modules/translation/translation.module2
-rw-r--r--modules/translation/translation.test7
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);