diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
index 3ed6127..ed7c55d 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
@@ -87,7 +87,11 @@ public function setValue($values, $notify = TRUE) {
    */
   public function applyDefaultValue($notify = TRUE) {
     // Default to LANGCODE_NOT_SPECIFIED.
-    $this->setValue(array('value' => Language::LANGCODE_NOT_SPECIFIED), $notify);
+    $langcode = Language::LANGCODE_NOT_SPECIFIED;
+    if (\Drupal::moduleHandler()->moduleExists('language') && $entity = $this->getEntity()) {
+      $langcode = language_get_default_langcode($entity->entityType(), $entity->bundle());
+    }
+    $this->setValue(array('value' => $langcode), $notify);
     return $this;
   }
 
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
index 15cd8f8..05c4238 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
@@ -53,7 +53,7 @@ public function form(array $form, array &$form_state) {
       '#description' => t('Create a new revision by default for this block type.')
     );
 
-    if (module_exists('content_translation')) {
+    if ($this->moduleHandler->moduleExists('language')) {
       $form['language'] = array(
         '#type' => 'details',
         '#title' => t('Language settings'),
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php
index fe45379..770b52e 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/Views/TranslationLinkTest.php
@@ -10,6 +10,7 @@
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\content_translation\Tests\ContentTranslationTestBase;
 use Drupal\views\Tests\ViewTestData;
+use Drupal\Core\Language\Language;
 
 /**
  * Tests the content translation overview link field handler.
@@ -51,6 +52,11 @@ function setUp() {
     $user->langcode = 'en';
     $user->save();
 
+    // Assign user 2 LANGCODE_NOT_SPECIFIED code so entity can't be translated.
+    $user = user_load(2);
+    $user->langcode = Language::LANGCODE_NOT_SPECIFIED;
+    $user->save();
+
     ViewTestData::createTestViews(get_class($this), array('content_translation_test_views'));
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
index 11903c1..e4995c0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityTranslationTest.php
@@ -112,6 +112,13 @@ protected function _testEntityLanguageMethods($entity_type) {
       'name' => 'test',
       'user_id' => $GLOBALS['user']->id(),
     ));
+    $this->assertEqual($entity->language()->id, language_default()->id, format_string('%entity_type: Entity created with API has default language.', array('%entity_type' => $entity_type)));
+
+    $entity = entity_create($entity_type, array(
+      'name' => 'test',
+      'user_id' => $GLOBALS['user']->id(),
+      'langcode' => Language::LANGCODE_NOT_SPECIFIED,
+    ));
     $this->assertEqual($entity->language()->id, Language::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity language not specified.', array('%entity_type' => $entity_type)));
     $this->assertFalse($entity->getTranslationLanguages(FALSE), format_string('%entity_type: No translations are available', array('%entity_type' => $entity_type)));
 
@@ -216,7 +223,7 @@ protected function _testMultilingualProperties($entity_type) {
 
     // Create a language neutral entity and check that properties are stored
     // as language neutral.
-    $entity = entity_create($entity_type, array('name' => $name, 'user_id' => $uid));
+    $entity = entity_create($entity_type, array('name' => $name, 'user_id' => $uid, 'langcode' => Language::LANGCODE_NOT_SPECIFIED));
     $entity->save();
     $entity = entity_load($entity_type, $entity->id());
     $this->assertEqual($entity->language()->id, Language::LANGCODE_NOT_SPECIFIED, format_string('%entity_type: Entity created as language neutral.', array('%entity_type' => $entity_type)));
@@ -299,6 +306,7 @@ protected function _testMultilingualProperties($entity_type) {
     entity_create($entity_type, array(
       'user_id' => $properties[$langcode]['user_id'],
       'name' => 'some name',
+      'langcode' => Language::LANGCODE_NOT_SPECIFIED,
     ))->save();
 
     $entities = entity_load_multiple($entity_type);
@@ -361,7 +369,7 @@ function testEntityTranslationAPI() {
     $langcode = $this->langcodes[1];
     $entity = $this->entityManager
       ->getStorageController('entity_test_mul')
-      ->create(array('name' => $this->randomName()));
+      ->create(array('name' => $this->randomName(), 'langcode' => Language::LANGCODE_NOT_SPECIFIED));
 
     $entity->save();
     $hooks = $this->getHooksInfo();
diff --git a/core/modules/views/lib/Drupal/views/Tests/Entity/EntityTranslationDefaultLanguageTest.php b/core/modules/views/lib/Drupal/views/Tests/Entity/EntityTranslationDefaultLanguageTest.php
new file mode 100644
index 0000000..6854f46
--- /dev/null
+++ b/core/modules/views/lib/Drupal/views/Tests/Entity/EntityTranslationDefaultLanguageTest.php
@@ -0,0 +1,155 @@
+<?php
+
+/**
+ * @file
+ * Tests for checking that default entity language is properly generated.
+ */
+
+namespace Drupal\system\Tests\Entity;
+
+use Drupal\Core\Language\Language;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests default language code is properly generated for entities.
+ */
+class EntityTranslationDefaultLanguageTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('language');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Entity Translation default language',
+      'description' => 'Test that entities are created with correct language code.',
+      'group' => 'Entity API',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+
+    // Create a new administrator user for the test.
+    $admin = $this->drupalCreateUser(
+      array(
+        'administer content types',
+        'administer languages',
+        'bypass node access',
+      )
+    );
+    $this->drupalLogin($admin);
+
+    // Activate Spanish language, so there are two languages activated.
+    $edit = array(
+      'predefined_langcode' => 'es',
+    );
+    $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language'));
+
+    // Create a new content type which has Undefined language by default.
+    $this->createContentType('ctund', Language::LANGCODE_NOT_SPECIFIED);
+    // Create a new content type which has Spanish language by default.
+    $this->createContentType('ctes', 'es');
+  }
+
+  /**
+   * Tests that default language code is properly set for new nodes.
+   */
+  public function testEntityTranslationDefaultLanguageViaCode() {
+    // With language module activated, and content type that is configured to
+    // have language "und" by default, a new node of this type will have "und"
+    // language code when language is not specified.
+    $node = $this->createNodeViaCode('ctund');
+    $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED);
+    // With language module activated, and content type that is configured to
+    // have language "und" by default, a new node of this type will have "es"
+    // language code when language "es" is specified.
+    $node = $this->createNodeViaCode('ctund', 'es');
+    $this->assertEqual($node->langcode->value, 'es');
+
+    // With language module activated, and content type that is configured to
+    // have language "es" by default, a new node of this type will have "es"
+    // language code when language is not specified.
+    $node = $this->createNodeViaCode('ctes');
+    $this->assertEqual($node->langcode->value, 'es');
+    // With language module activated, and content type that is configured to
+    // have language "es" by default, a new node of this type will have "en"
+    // language code when language "en" is specified.
+    $node = $this->createNodeViaCode('ctes', 'en');
+    $this->assertEqual($node->langcode->value, 'en');
+
+    // Disable language module.
+    $this->container->get('module_handler')->uninstall(array('language'), FALSE);
+
+    // With language module disabled, and content type that is configured to
+    // have language "und" by default, a new node of this type will have "und"
+    // language code when language is not specified.
+    $node = $this->createNodeViaCode('ctund');
+    $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED);
+    // With language module disabled, and content type that is configured to
+    // have language "und" by default, a new node of this type will have "es"
+    // language code when language "es" is specified.
+    $node = $this->createNodeViaCode('ctund', 'es');
+    $this->assertEqual($node->langcode->value, 'es');
+
+    // With language module disabled, and content type that is configured to
+    // have language "es" by default, a new node of this type will have "und"
+    // language code when language is not specified.
+    $node = $this->createNodeViaCode('ctes');
+    $this->assertEqual($node->langcode->value, Language::LANGCODE_NOT_SPECIFIED);
+    // With language module disabled, and content type that is configured to
+    // have language "es" by default, a new node of this type will have "en"
+    // language code when language "en" is specified.
+    $node = $this->createNodeViaCode('ctes', 'en');
+    $this->assertEqual($node->langcode->value, 'en');
+  }
+
+  /**
+   * Creates a new node content type.
+   *
+   * @param name
+   *   The content type name.
+   * @param $langcode
+   *   Default language code of the nodes of this type.
+   */
+  protected function createContentType($name, $langcode) {
+    $edit = array(
+      'name' => 'Test ' . $name,
+      'title_label' => 'Title',
+      'type' => $name,
+      'language_configuration[langcode]' => $langcode,
+    );
+    $this->drupalPostForm('admin/structure/types/add', $edit, t('Save content type'));
+  }
+
+  /**
+   * Creates a new node of given type and language using Entity API.
+   *
+   * @param $type
+   *   The node content type.
+   * @param $langcode
+   *   (optional) Language code of the node to create.
+   *   If blank, it will be determined by the content type configuration.
+   *
+   * @return \Drupal\node\Entity
+   *   The node created.
+   */
+  protected function createNodeViaCode($type, $langcode = NULL) {
+    $data = array(
+      'type' => $type,
+      'title' => $this->randomName(),
+    );
+    if (!empty($langcode)) {
+      $data['langcode'] = $langcode;
+    }
+    $node = entity_create(
+      'node',
+      $data
+    );
+    return $node;
+  }
+
+}
