diff --git a/core/lib/Drupal/Core/Entity/EntityType.php b/core/lib/Drupal/Core/Entity/EntityType.php
index 7f49c1876da62f96e2532df5424b60e4b7dfe709..7072ef5701d6123d00bebbf22848fd24e09fd862 100644
--- a/core/lib/Drupal/Core/Entity/EntityType.php
+++ b/core/lib/Drupal/Core/Entity/EntityType.php
@@ -696,7 +696,7 @@ public function getDataTable() {
    * {@inheritdoc}
    */
   public function getLabel() {
-    return (string) $this->label;
+    return $this->label;
   }
 
   /**
@@ -733,7 +733,7 @@ public function getGroup() {
    * {@inheritdoc}
    */
   public function getGroupLabel() {
-    return !empty($this->group_label) ? (string) $this->group_label : $this->t('Other', array(), array('context' => 'Entity type group'));
+    return !empty($this->group_label) ? $this->group_label : $this->t('Other', array(), array('context' => 'Entity type group'));
   }
 
   /**
diff --git a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
index 3ce16ab56783ce8a44cec6d5de8870f1506cfb66..376fef859100e7a546d48b63ece8e98f13633a54 100644
--- a/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
+++ b/core/modules/entity_reference/src/ConfigurableEntityReferenceItem.php
@@ -83,7 +83,7 @@ public function getSettableOptions(AccountInterface $account = NULL) {
       // The label does not need sanitizing since it is used as an optgroup
       // which is only supported by select elements and auto-escaped.
       $bundle_label = $bundles[$bundle]['label'];
-      $return[$bundle_label] = $entity_ids;
+      $return[(string) $bundle_label] = $entity_ids;
     }
 
     return count($return) == 1 ? reset($return) : $return;
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
index 3b47dbe56789eae34de619ac9740a12fb64f1812..84076c5c2ee4ab23b17d28aa43216366683ec592 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
@@ -9,6 +9,8 @@
 
 use Drupal\Core\Entity\EntityType;
 use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\StringTranslation\TranslatableString;
+use Drupal\Core\StringTranslation\TranslationInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -283,6 +285,44 @@ public function testId() {
     $this->assertEquals($id, $entity_type->id());
   }
 
+  /**
+   * @covers ::getLabel
+   */
+  public function testGetLabel() {
+    $translatable_label = new TranslatableString($this->randomMachineName());
+    $entity_type = $this->setUpEntityType(array('label' => $translatable_label));
+    $this->assertSame($translatable_label, $entity_type->getLabel());
+
+    $label = $this->randomMachineName();
+    $entity_type = $this->setUpEntityType(array('label' => $label));
+    $this->assertSame($label, $entity_type->getLabel());
+  }
+
+  /**
+   * @covers ::getGroupLabel
+   */
+  public function testGetGroupLabel() {
+    $translatable_group_label = new TranslatableString($this->randomMachineName());
+    $entity_type = $this->setUpEntityType(array('group_label' => $translatable_group_label));
+    $this->assertSame($translatable_group_label, $entity_type->getGroupLabel());
+
+    $default_label = $this->randomMachineName();
+    $entity_type = $this->setUpEntityType(array('group_label' => $default_label));
+    $this->assertSame($default_label, $entity_type->getGroupLabel());
+
+    $default_label = new TranslatableString('Other', array(), array('context' => 'Entity type group'));
+    $entity_type = $this->setUpEntityType([]);
+
+    $string_translation = $this->getMock(TranslationInterface::class);
+    $string_translation->expects($this->atLeastOnce())
+      ->method('translate')
+      ->with('Other', array(), array('context' => 'Entity type group'))
+      ->willReturn($default_label);
+    $entity_type->setStringTranslation($string_translation);
+
+    $this->assertSame($default_label, $entity_type->getGroupLabel());
+  }
+
   /**
    * Gets a mock controller class name.
    *